Unitees : - ETM : mg/kg - Densitee apparentes : g/m3

Contextes et objectifs

Cette etude consiste a valoriser les donnees sur les Elements Traces Metalliques (ETM) issues de la premiere campagne (2000-2009) du Reseau de Mesure et de la Qualite des Sols (RMQS). Pour ce faire, plusieurs voies ont ete considerees, en commencant par une etude statistique sur les deux couches d’analyse du RMQS (H1 : 0-30 cm et H2 : 30-50cm) en utilisant les ETM selectionnes : Arsenic, Cadmium, Chrome, Cuivre, Cobalte, Molybdene, Nickel, Plomb et Zinc.

Les differentes pistes abordees sont les suivantes :

  • Analyse exploratoire entre H1 et H2 pour tout les ETM possedant l’information sur les deux couches.
  • Etude et spatialisation des concentration en ETM sur la France metropolitaine.
  • Calcul des stocks totaux pour s’absoudre de la variabilite sur la profondeur de H2.
  • Cartographie des stocks totaux et des concentrations sur H1 et sur H2.
  • Spatialisation de l’information stock total pour la prise en compte du support variable des observations (profondeurs variables sur H2)

Extraction des donnees volumetriques

Dans le but d’obtenir une version plus recente de la table analyse volumetrique ponderee present dans l’entrepot (la derniere version datant de 2011), une extraction est effectuee sur la derniere version de la table mesures_echantillons_volumetriques du schema dm_donnees_ponctuelles. Cette table contient l’integralite des estimations massiques en elements grossiers (cailloux et graviers), en terre fine, le volume de l’echantillon…

Encore une fois, cette extraction est realisee uniquement sur les echantillons composites de la campagne 1. Deplus, les observations presentant des anomalies sont filtrees : Sites ne respectant pas la convention de prelevement par couche RMQS (prelevement par horizons de sol), observations avec une profondeur en sommet >50cm…

De plus, les echantillons preleves dans le cadre du projet BIOSOL n’ayant pas de donnees volumetriques pour la couche 2 (30-50cm), ne presente pas de stock ETM total. Neansmoins, un stock est calcule sur la couche 1 comme pour les autres points du RMQS.

Dans un soucis de simplification, et en attendant la mise a jour officielle des donnees ponderres de l’entrepot, les variables necessaires au calcul des stocks en ETM ont ete estimees comme suit :

Elements grossiers

\[Eg = (graviers+cailloux)/masse~seche\times100 \] Avec Eg le pourcentage en elements grossiers dans l’echantillon seche selon le rapport de la masse cumulee des fractions en elements grossiers presant dans l’echantillon.

# Commande SQL pour l'extraction des donnees volumetriques
connection=RODBC::odbcConnect("dela")

req_vol <- "SELECT id_campagne, id_site, type_profil_rmqs, no_horizon, no_prelevement, 
prof_sup_moy, prof_inf_moy, prof_sommet, prof_base, id_analyse, 
eg_graviers_masse as masse_eg_graviers,  
eg_cailloux_masse as masse_eg_cailloux,  da_volume_total as volume, 
da_masse_humide as masse_humide, da_masse_seche as masse_seche,  
da_no_methode, round((da_masse_seche/da_volume_total),2) as densite_apparente, round(( (eg_graviers_masse + eg_cailloux_masse) /da_masse_seche * 100 ), 2) as teneur_eg, round(((da_masse_humide-da_masse_seche)/da_masse_seche * 100), 2) as teneur_eau
FROM dm_donnees_ponctuelles.mesures_echantillons_volumetriques_rmqs 
where id_campagne in ('1') and round((da_masse_seche/da_volume_total),2) is not null and type_profil_rmqs = 'C'
--and numero_annee_rmqs2 = '4'

--and region_partenaire ilike '%PACA%'

order by id_site, no_horizon, prof_sommet "

data_vol_tot <- sqlQuery(connection,req_vol)

odbcClose(connection) # fct de fermeture de la connection

# Nettoyage des donnees aberantes
Id_h3 <- unique(data_vol_tot[which(data_vol_tot$no_horizon%in%c(3,4,5,6,7,8)),"id_site"])
data_vol_tot_h3 <- data_vol_tot[which(data_vol_tot$id_site%in%Id_h3),]
data_vol_tot <- data_vol_tot[-which(data_vol_tot$id_site%in%Id_h3),]

data_vol_tot <- data_vol_tot[-which(data_vol_tot$prof_sommet>50),]

# Ponderation par id_site et par horizon (h1 - h2 - h9)
data_EG <- NULL
for(i in unique(data_vol_tot$id_site)){# traitement des donnees vol par site

    dupli_ETM <- data_vol_tot[which(data_vol_tot$id_site==i),]
  
  for(hh in unique(dupli_ETM$no_horizon)){# traitement des donnee par hz
    
    dupli_ETM_hz <- dupli_ETM[which(dupli_ETM$no_horizon==hh),]

    recap_meth <- as.data.frame(table(dupli_ETM_hz$da_no_methode))# Observation du nombre de methode dans l'horizon selectionne
    
    if(nrow(recap_meth)>1){# si plusieurs methode appliquee
    
     if(nrow(recap_meth[which(recap_meth$Var1==0.1),])>0){# On enleve les methode non identifie
        
        recap_meth <-  recap_meth[-which(recap_meth$Var1==0.1),]

      }
      
      if(hh==1 && c(2)%in%unique(dupli_ETM$no_horizon)){# Condition pour sauvegarder une continuite de la methode entre h1 et h2
        
        recap_meth <- as.data.frame(table(dupli_ETM[which(dupli_ETM$no_horizon==2),]$da_no_methode))
        
      }else if(hh==2){
        
        recap_meth <- as.data.frame(table(data_EG[which(data_EG$no_horizon==1 & data_EG$id_site==i),]$no_methode))# respect de la continuite entre l'horizon h2 et l'horizon h1
        
      }
        
        if(length(unique(dupli_ETM$no_horizon))==1){
        
        recap_meth <- recap_meth[1,]
      }
      
      
      dupli_ETM_hz <- dupli_ETM_hz[which(dupli_ETM_hz$da_no_methode==recap_meth[which(recap_meth$Freq==max(recap_meth$Freq)),1]),]
    
    }
    
    # Sauvegarde des epaisseur des echantillons volumetriques
     Data_h_site <- as.data.frame(i)
    colnames(Data_h_site) <- "id_site"
    Data_h_site$no_horizon <-hh
    Data_h_site$prof_sommet <- ifelse(is.na(sum(dupli_ETM_hz$prof_sommet)),min(na.omit(dupli_ETM_hz$prof_inf_moy)), min(na.omit(dupli_ETM_hz$prof_sommet)))
    Data_h_site$prof_base <- ifelse(is.na(sum(dupli_ETM_hz$prof_base)),min(na.omit(dupli_ETM_hz$prof_sup_moy)), max(na.omit(dupli_ETM_hz$prof_base)))
   
    Data_h_site$EG_pond <- (sum(na.omit(dupli_ETM_hz$masse_eg_graviers))+sum(na.omit(dupli_ETM_hz$masse_eg_cailloux)))/sum(na.omit(dupli_ETM_hz$masse_seche))*100
    Data_h_site$DA_pond <- sum(na.omit(dupli_ETM_hz$masse_seche))/sum(na.omit(dupli_ETM_hz$volume))
    Data_h_site$no_methode <- unique(dupli_ETM_hz$da_no_methode)
    
        data_EG <- rbind(data_EG,Data_h_site)
  }
 
  
}


data_ETM <- data_ETM[complete.cases(data_ETM$x_reel,data_ETM$y_reel),]

# Filtre les doublon de la table densite apparente
data_ETM$no_horizon <- as.numeric(as.character(data_ETM$no_horizon))
data_ETM <- left_join(data_ETM,data_EG,by=c("id_site"="id_site","no_horizon"="no_horizon"))

colnames(data_ETM)[87] <- "DA"
colnames(data_ETM)[86]<- "abondance_eg"

# Save data
write.csv2(data_vol_tot,paste0(Workdir,"/ETM_volumetrique_traitees.csv"))
write.csv2(data_ETM, paste0(Workdir,"/ETM_DA_pred_TOT.csv"), 
           row.names = FALSE)
# Importation du shapefile France
load("D:/WorkSpace/decoupage_administratif/france_entiere/bd_topo/contour_france.RData")

# Horizon 1
da_H1 <- data_ETM %>% filter(no_horizon == 1)%>%dplyr::select(abondance_eg)
mybreaks1 <- unique(round(unname(quantile(na.omit(da_H1$abondance_eg))),3))

ggplot() + 
      geom_polygon(data=FceMetCorse_coord, aes(long,lat, group = group), fill= "gray82", colour="grey") +
      coord_equal() +
      geom_point(data = data_ETM%>% filter(no_horizon == 1) , 
                 aes(x = x_reel, y = y_reel, size = abondance_eg,color=abondance_eg),shape=20, stroke=FALSE)+
   scale_size_continuous(name="Element grossiers H1 (%)",breaks = mybreaks1,range=c(0.1,3.5))+
   scale_color_viridis(name="Element grossiers H1 (%)",breaks = mybreaks1)+
    theme_void() + 
 guides( colour = guide_legend()) + 
  theme(legend.position = "right")

# Horizon 2
da_H2 <- data_ETM %>% filter(no_horizon == 2)%>%dplyr::select(abondance_eg)
mybreaks2 <- unique(round(unname(quantile(na.omit(da_H2$abondance_eg))),3))

ggplot() + 
      geom_polygon(data=FceMetCorse_coord, aes(long,lat, group = group), fill= "gray82", colour="grey") +
      coord_equal() +
      geom_point(data = data_ETM %>% filter(no_horizon == 2), 
                 aes(x = x_reel, y = y_reel, size = abondance_eg,color=abondance_eg),shape=20, stroke=FALSE)+
   scale_size_continuous(name="Element grossiers H2 (%)",breaks = mybreaks2,range=c(0.1,3.5))+
   scale_color_viridis(name="Element grossiers H2 (%)",breaks = mybreaks2)+
    theme_void() + 
 guides( colour = guide_legend()) + 
  theme(legend.position = "right")

Densite apparente

\[Da = massse~seche/volume~total \] Avec Da la densite apparente corespondant a la masse seche de l’echantillon par rapport a son volume total.

# Horizon 9
da_H9 <- data_ETM %>% filter(no_horizon == 9)%>%dplyr::select(DA)
mybreaks9 <- unique(round(unname(quantile(na.omit(da_H9$DA))),3))

ggplot() + 
      geom_polygon(data=FceMetCorse_coord, aes(long,lat, group = group), fill= "gray82", colour="grey") +
      coord_equal() +
      geom_point(data = data_ETM%>% filter(no_horizon == 9) , 
                 aes(x = x_reel, y = y_reel, size = DA,color=DA),shape=20, stroke=FALSE)+
   scale_size_continuous(name="Densitee apparente H9 (g/cm3)",breaks = mybreaks9,range=c(0.1,3.5))+
   scale_color_viridis( name="Densitee apparente H9 (g/cm3)",breaks = mybreaks9)+
    theme_void() + 
 guides( colour = guide_legend()) + 
  theme(legend.position = "right")

# Horizon 1
da_H1 <- data_ETM %>% filter(no_horizon == 1)%>%dplyr::select(DA)
mybreaks1 <- unique(round(unname(quantile(na.omit(da_H1$DA))),3))

ggplot() + 
      geom_polygon(data=FceMetCorse_coord, aes(long,lat, group = group), fill= "gray82", colour="grey") +
      coord_equal() +
      geom_point(data = data_ETM%>% filter(no_horizon == 1) , 
                 aes(x = x_reel, y = y_reel, size = DA,color=DA),shape=20, stroke=FALSE)+
   scale_size_continuous(name="Densitee apparente H1 (g/cm3)",breaks = mybreaks1,range=c(0.1,3.5))+
   scale_color_viridis( name="Densitee apparente H1 (g/cm3)",breaks = mybreaks1)+
    theme_void() + 
 guides( colour = guide_legend()) + 
  theme(legend.position = "right")

# Horizon 2
da_H2 <- data_ETM %>% filter(no_horizon == 2)%>%dplyr::select(DA)
mybreaks2 <-unique(round(unname(quantile(na.omit(da_H2$DA))),3))

ggplot() + 
      geom_polygon(data=FceMetCorse_coord, aes(long,lat, group = group), fill= "gray82", colour="grey") +
      coord_equal() +
      geom_point(data = data_ETM %>% filter(no_horizon == 2), 
                 aes(x = x_reel, y = y_reel, size = DA,color=DA),shape=20, stroke=FALSE)+
   scale_size_continuous(name="Densitee apparente H2 (g/cm3)",breaks = mybreaks2,range=c(0.1,3.5))+
   scale_color_viridis(name="Densitee apparente H2 (g/cm3)",breaks = mybreaks2)+
    theme_void() + 
 guides( colour = guide_legend()) + 
  theme(legend.position = "right")

Calcul des stocks

Dans un soucis de transformation des unitees, nous utilisons la donnees DA, originellement en g/cm3, en kg/cm3. De plus, nous calculons l’epaisseur de chaque horizon a partir de la profondeur superieur et inferieur de l’horizon que nous gardons en cm.

# Preparation de la donnee
data_ETM$DA <- data_ETM$DA/1000 # g/cm3 en kg/cm3
data_ETM$Epaisseur <- abs(data_ETM$profondeur_hz_inf-data_ETM$profondeur_hz_sup) #calcul des epaisseurs en cm

# Function Recap
Stock_calc <- function(df,ETM,colout){
  
  df[,colout] <- ifelse(is.na(df$abondance_eg),
                        df[,ETM]*df$Epaisseur*df$DA,# H9
                        df[,ETM]*df$Epaisseur*(1-(df$abondance_eg/100))*df$DA) # H1 et H2 mg/cm2
  df[,colout] <- df[,colout]*10000 # mg/m2
  
  return(df)
}

ETM.base <-c("as_tot_hf","cd_tot_hf","co_tot_hf","cr_tot_hf_RMQS","cr_tot_hf_RMQS1Bis","cu_tot_hf","ni_tot_hf",
             "pb_tot_hf","zn_tot_hf","mo_tot_hf","cd_ext_edta","cr_ext_edta","ni_ext_edta","pb_ext_edta","zn_ext_edta",
             "cu_ext_edta") 
St.ETM <- c("Stock_as_hf","Stock_cd_hf","Stock_co_hf","Stock_cr_hf_RMQS","Stock_cr_hf_RMQS1Bis","Stock_cu_hf",
            "Stock_ni_hf",
            "Stock_pb_hf","Stock_zn_hf","Stock_mo_hf","Stock_cd_edta","Stock_cr_edta","Stock_ni_edta","Stock_pb_edta","Stock_zn_edta",
            "Stock_cu_edta") 

# Calcul des stock par horizon
for( j in 1:length(ETM.base)){
  
  data_ETM <- Stock_calc(data_ETM,ETM.base[j],St.ETM[j])
  
}

write.csv2(data_ETM, paste0(Workdir,"/Stock_ETM_data.csv"), 
           row.names = FALSE)

Nous pouvons observer la variabilite de cette epaisseur pour chaque horizon :

# Epaisseur
mybreaks1 <- unique(unname(quantile(na.omit(data_ETM[which(data_ETM$no_horizon==1),"Epaisseur"])))[1:5])
mybreaks2 <- unique(unname(quantile(na.omit(data_ETM[which(data_ETM$no_horizon==2),"Epaisseur"])))[1:5])
mybreaks9 <- unique(unname(quantile(na.omit(data_ETM[which(data_ETM$no_horizon==9),"Epaisseur"])))[1:5])

# H1
ggplot() + 
      geom_polygon(data=FceMetCorse_coord, aes(long,lat, group = group), fill= "gray82", colour="grey") +
      coord_equal() +
      geom_point(data = data_ETM %>% filter(no_horizon == 1) , 
                 aes(x = x_reel, y = y_reel, size = Epaisseur,color=Epaisseur),shape=20, stroke=FALSE)+
   scale_size_continuous(name="Epaisseur H1 (cm)",breaks = mybreaks1,range=c(0.1,3.5))+
   scale_color_viridis(trans="log", name="Epaisseur H1 (cm)",breaks = mybreaks1)+
    theme_void() + 
 guides( colour = guide_legend()) + 
  theme(legend.position = "right")

# H2
ggplot() + 
      geom_polygon(data=FceMetCorse_coord, aes(long,lat, group = group), fill= "gray82", colour="grey") +
      coord_equal() +
      geom_point(data = data_ETM %>% filter(no_horizon == 2) , 
                 aes(x = x_reel, y = y_reel, size = Epaisseur,color=Epaisseur),shape=20, stroke=FALSE)+
   scale_size_continuous(name="Epaisseur H2 (cm)",breaks = mybreaks2,range=c(0.1,3.5))+
   scale_color_viridis(trans="log", name="Epaisseur H2 (cm)",breaks = mybreaks2)+
    theme_void() + 
 guides( colour = guide_legend()) + 
  theme(legend.position = "right")

# H9
ggplot() + 
      geom_polygon(data=FceMetCorse_coord, aes(long,lat, group = group), fill= "gray82", colour="grey") +
      coord_equal() +
      geom_point(data = data_ETM %>% filter(no_horizon == 9) , 
                 aes(x = x_reel, y = y_reel, size = Epaisseur,color=Epaisseur),shape=20, stroke=FALSE)+
   scale_size_continuous(name="Epaisseur H9 (cm)",breaks = mybreaks9,range=c(0.1,3.5))+
   scale_color_viridis(trans="log", name="Epaisseur H9 (cm)",breaks = mybreaks9)+
    theme_void() + 
 guides( colour = guide_legend()) + 
  theme(legend.position = "right")

Afin de s’absoudre de l’heterogeneite des epaisseurs dans les donnees au sein des horizons, pour la spatialisation, nous avons choisis de calculer le stock total pour chaque ETM en cumulant les stocks de chaque couche (H1+H2+H9) :

\[\sum_{i=1}^n Stock_i = C_i \times Ep_i \times (1-Eg/100) \times Da_i\]

Avec C la teneur en ETM, Ep l’epaisseur de l’horizon, Eg le pourcentage d’elements grossiers et Da la densitee apparente.

Cartogramme des stocks

Les cartogrammes presentes ci-dessous sont etablie a partir des coordonnees theoriques des points RMQS et ne correspondent pas a leur possition GPS reelle.

# CADMIUM
Stock_cd_HF <- data_ETM %>% 
  group_by(id_site,x_reel,y_reel,x_theo,y_theo,occupation,type_sol2,domaine_geo) %>%
  dplyr::summarise(Sum_stock_cd_hf = sum(Stock_cd_hf))%>%
  as.data.frame()

mybreaks1 <- unique(round(unname(quantile(na.omit(Stock_cd_HF[,"Sum_stock_cd_hf"]))),3))

test <- Stock_cd_HF%>%dplyr::select(x_theo,y_theo,Sum_stock_cd_hf)%>%
  sf::st_as_sf(coords = c("x_theo","y_theo"), crs = 2154)%>%na.omit()%>%
  mapview(zcol = "Sum_stock_cd_hf",layer.name = c("Stock Cadmium Total mg/m2"),cex="Sum_stock_cd_hf",at=mybreaks1,burst=FALSE, alpha = 0.5 )

Stock_cd_EDTA <- data_ETM %>% 
  group_by(id_site,x_reel,y_reel,x_theo,y_theo,occupation,type_sol2,domaine_geo) %>% 
  dplyr::summarise(Sum_stock_cd_edta = sum(Stock_cd_edta))%>%
  as.data.frame()

save(Stock_cd_HF,file=paste0(StockDirectory,"/Stock_cd_HF.RData"))
save(Stock_cd_EDTA,file=paste0(StockDirectory,"/Stock_cd_EDTA.RData"))

# COBALTE
Stock_co_HF <- data_ETM %>% 
  group_by(id_site,x_reel,y_reel,x_theo,y_theo,occupation,type_sol2,domaine_geo) %>%
  dplyr::summarise(Sum_stock_co_hf = sum(Stock_co_hf))%>%
  as.data.frame()

mybreaks2 <- unique(round(unname(quantile(na.omit(Stock_co_HF[,"Sum_stock_co_hf"]))),3))

test2 <- Stock_co_HF%>%dplyr::select(x_theo,y_theo,Sum_stock_co_hf)%>%
  sf::st_as_sf(coords = c("x_theo","y_theo"), crs = 2154)%>%na.omit()%>%
  mapview(zcol = "Sum_stock_co_hf",layer.name = c("Stock Cobalte Total mg/m2"),cex="Sum_stock_co_hf",at=mybreaks2,burst=FALSE, alpha = 0.5 )

save(Stock_co_HF,file=paste0(StockDirectory,"/Stock_co_HF.RData"))

# CHROME
Stock_cr_edta <- data_ETM %>% 
  group_by(id_site,x_reel,y_reel,x_theo,y_theo,occupation,type_sol2,domaine_geo) %>% 
  dplyr::summarise(Sum_stock_cr_edta = sum(Stock_cr_edta))%>%
  as.data.frame()

Stock_cr_hf_RMQS <- data_ETM %>% 
  group_by(id_site,x_reel,y_reel,x_theo,y_theo,occupation,type_sol2,domaine_geo) %>% 
  dplyr::summarise(Sum_stock_cr_hf_RMQS1 = sum(Stock_cr_hf_RMQS))%>%
  as.data.frame()

mybreaks3 <- unique(round(unname(quantile(na.omit(Stock_cr_hf_RMQS[,"Sum_stock_cr_hf_RMQS1"]))),3))

test3 <- Stock_cr_hf_RMQS%>%dplyr::select(x_theo,y_theo,Sum_stock_cr_hf_RMQS1)%>%
  sf::st_as_sf(coords = c("x_theo","y_theo"), crs = 2154)%>%na.omit()%>%
  mapview(zcol = "Sum_stock_cr_hf_RMQS1",layer.name = c("Stock Chrome Total mg/m2"),cex="Sum_stock_cr_hf_RMQS1",at=mybreaks3,burst=FALSE, alpha = 0.5 )


save(Stock_cr_edta,file=paste0(StockDirectory,"/Stock_cr_edta.RData"))
save(Stock_cr_hf_RMQS,file=paste0(StockDirectory,"/Stock_cr_hf_RMQS.RData"))

# CHROME 1 et 1Bis
Stock_cr_hf_RMQS1<- data_ETM[which(data_ETM$no_horizon==1),
                             c("id_site","x_reel","y_reel","occupation","type_sol2","domaine_geo","Stock_cr_hf_RMQS")] 
Stock_cr_hf_RMQS1Bis<- data_ETM[which(data_ETM$no_horizon==1),
                             c("id_site","x_reel","y_reel","occupation","type_sol2","domaine_geo","Stock_cr_hf_RMQS1Bis")] 

save(Stock_cr_hf_RMQS1,file=paste0(StockDirectory,"/Stock_cr_hf_RMQS1.RData"))
save(Stock_cr_hf_RMQS1Bis,file=paste0(StockDirectory,"/Stock_cr_hf_RMQS1Bis.RData"))

# CUIVRE
Stock_cu_HF <- data_ETM %>% 
  group_by(id_site,x_reel,y_reel,x_theo,y_theo,occupation,type_sol2,domaine_geo) %>%
  dplyr::summarise(Sum_stock_cu_hf = sum(Stock_cu_hf))%>%
  as.data.frame()

mybreaks4 <- unique(round(unname(quantile(na.omit(Stock_cu_HF[,"Sum_stock_cu_hf"]))),3))

test4 <- Stock_cu_HF%>%dplyr::select(x_theo,y_theo,Sum_stock_cu_hf)%>%
  sf::st_as_sf(coords = c("x_theo","y_theo"), crs = 2154)%>%na.omit()%>%
  mapview(zcol = "Sum_stock_cu_hf",layer.name = c("Stock Cuivre Total mg/m2"),cex="Sum_stock_cu_hf",at=mybreaks4,burst=FALSE, alpha = 0.5 )

Stock_cu_EDTA <- data_ETM %>% 
  group_by(id_site,x_reel,y_reel,x_theo,y_theo,occupation,type_sol2,domaine_geo) %>% 
  dplyr:: summarise(Sum_stock_cu_edta = sum(Stock_cu_edta))%>%
  as.data.frame()

save(Stock_cu_HF,file=paste0(StockDirectory,"/Stock_cu_HF.RData"))
save(Stock_cu_EDTA,file=paste0(StockDirectory,"/Stock_cu_EDTA.RData"))

# MOLYBDENE
Stock_mo_HF <- data_ETM %>% 
  group_by(id_site,x_reel,y_reel,x_theo,y_theo,occupation,type_sol2,domaine_geo) %>%
  dplyr::summarise(Sum_stock_mo_hf = sum(Stock_mo_hf))%>%
  as.data.frame()

mybreaks5 <- unique(round(unname(quantile(na.omit(Stock_mo_HF[,"Sum_stock_mo_hf"]))),3))

test5 <- Stock_mo_HF%>%dplyr::select(x_theo,y_theo,Sum_stock_mo_hf)%>%
  sf::st_as_sf(coords = c("x_theo","y_theo"), crs = 2154)%>%na.omit()%>%
  mapview(zcol = "Sum_stock_mo_hf",layer.name = c("Stock Molybdene Total mg/m2"),cex="Sum_stock_mo_hf",at=mybreaks5,burst=FALSE, alpha = 0.5 )


save(Stock_mo_HF,file=paste0(StockDirectory,"/Stock_mo_HF.RData"))

# PLOMB
Stock_pb_HF <- data_ETM %>% 
  group_by(id_site,x_reel,y_reel,x_theo,y_theo,occupation,type_sol2,domaine_geo) %>%
  dplyr::summarise(Sum_stock_pb_hf = sum(Stock_pb_hf))%>%
  as.data.frame()

mybreaks6 <- unique(round(unname(quantile(na.omit(Stock_pb_HF[,"Sum_stock_pb_hf"]))),3))

test6 <- Stock_pb_HF%>%dplyr::select(x_theo,y_theo,Sum_stock_pb_hf)%>%
  sf::st_as_sf(coords = c("x_theo","y_theo"), crs = 2154)%>%na.omit()%>%
  mapview(zcol = "Sum_stock_pb_hf",layer.name = c("Stock Plomb Total mg/m2"),cex="Sum_stock_pb_hf",at=mybreaks6,burst=FALSE, alpha = 0.5 )


Stock_pb_EDTA <- data_ETM %>% 
  group_by(id_site,x_reel,y_reel,x_theo,y_theo,occupation,type_sol2,domaine_geo) %>% 
  dplyr::summarise(Sum_stock_pb_edta = sum(Stock_pb_edta))%>%
  as.data.frame()

save(Stock_pb_HF,file=paste0(StockDirectory,"/Stock_pb_HF.RData"))
save(Stock_pb_EDTA,file=paste0(StockDirectory,"/Stock_pb_EDTA.RData"))

# ZINC
Stock_zn_HF <- data_ETM %>% 
  group_by(id_site,x_reel,y_reel,x_theo,y_theo,occupation,type_sol2,domaine_geo) %>%
  dplyr::summarise(Sum_stock_zn_hf = sum(Stock_zn_hf))%>%
  as.data.frame()

mybreaks7 <- unique(round(unname(quantile(na.omit(Stock_zn_HF[,"Sum_stock_zn_hf"]))),3))

test7 <- Stock_zn_HF%>%dplyr::select(x_theo,y_theo,Sum_stock_zn_hf)%>%
  sf::st_as_sf(coords = c("x_theo","y_theo"), crs = 2154)%>%na.omit()%>%
  mapview(zcol = "Sum_stock_zn_hf",layer.name = c("Stock Zinc Total mg/m2"),cex="Sum_stock_zn_hf",at=mybreaks7,burst=FALSE, alpha = 0.5 )


Stock_zn_EDTA <- data_ETM %>% 
  group_by(id_site,x_reel,y_reel,x_theo,y_theo,occupation,type_sol2,domaine_geo) %>% 
  dplyr::summarise(Sum_stock_zn_edta = sum(Stock_zn_edta))%>%
  as.data.frame()

save(Stock_zn_HF,file=paste0(StockDirectory,"/Stock_zn_HF.RData"))
save(Stock_zn_EDTA,file=paste0(StockDirectory,"/Stock_zn_EDTA.RData"))

test+test2+test3+test4+test5+test6+test7

Statistique descriptive stocks totaux par OCS

# Importation des donnees sources
files.Rdata <- list.files(StockDirectory,pattern = paste0("Stock",".*",".RData$"))


for(i in 1:length(files.Rdata)){
 
  setwd(StockDirectory)
  
  Stock1 <- get(load(files.Rdata[i]))
  
  if(i==1){
    
    Stock_All <- Stock1
    
  }else{
    
    Stock_All <- left_join(Stock_All,Stock1[,c(1,ncol(Stock1))],by=c("id_site"))
    
  }
  
  
}

Stock_All <- as.data.frame(Stock_All)
Stock_All <- Stock_All[-which(Stock_All$occupation=="foret"),]

# Creation d'un niveau de facteur de la covariable nom_occupation pour le cas de toutes occupations confondues pour le jeu de donnees dataSet
## Occupation
tmp <- Stock_All
tmp$occupation <- 'TtesOccupations'
Stock_All <- rbind.data.frame(Stock_All , tmp)
rm(tmp)

levels(Stock_All$occupation)[nlevels(Stock_All$occupation)] <- c("Toute_occupation_sauf_foret")

# Etudes statistiques relatives a la teneur en Elements chimiques ou  en grandeurs physico-chimique 

Grandeur <- c("Sum_stock_cd_edta","Sum_stock_cd_hf","Sum_stock_co_hf",
              "Sum_stock_cr_edta","Sum_stock_cr_hf_RMQS1",
              "Sum_stock_cu_edta","Sum_stock_cu_hf",    
              "Sum_stock_mo_hf","Sum_stock_pb_edta","Sum_stock_pb_hf","Sum_stock_zn_edta" ,"Sum_stock_zn_hf"     
                  
)

# Preparation des commentaires qui accompagneront les tables generees dans la partie suivante

GrandeurExplicite <- c("Stock total Cadmium EDTA","Stock total Cadmium HF","Stock total Cobalt HF","Stock total Chrome EDTA",
                       "Stock total Chrome RMQS1 HF","Stock total Cuivre EDTA","Stock total Cuivre HF",
                       "Stock total Molybdene HF","Stock total Plomb EDTA","Stock total Plomb HF","Stock total Zinc EDTA","Stock total Zinc HF")

# Definition de la variables de regroupement pour les tables finales
strateVar <- "occupation"
Stock_All$occupation <- as.factor(Stock_All$occupation)
levels(Stock_All$occupation) <- c("Culture permanente","Grande culture","Parc","Prairie","Sol nu","Toute occupation sauf foret","Vegetation naturelle","Zone humide")

strates <- levels(Stock_All[, strateVar])

Stock_All$no_horizon <- 1
couches <- 1

# Jointure du numero de cellule
Stock_All <- left_join(Stock_All,no_cellule[,c(9,10)],by=c("id_site"))
Stock_All <- Stock_All[-which(duplicated(Stock_All)),]
colnames(Stock_All)[ncol(Stock_All)] <- "no_cellule"

#setup parallel backend to use many processors
cores = detectCores()
cl <- makeCluster(3) #not to overload your computer
registerDoParallel(cl)

# #setup parallel backend to use many processors
# cores = detectCores()
# cl <- makeCluster(2) #not to overload your computer
# registerDoParallel(cl)

resufinal    <-
  foreach(
    i = 1:length(Grandeur) ,#31:33 ,#
    .combine = rbind.data.frame,
    .export = "samplingDesignStats",
    .packages = c("sp", "spcosa", "foreach"),
    .verbose=FALSE
  ) %dopar% {
    
    
    resucouche <- 
      foreach(
        j = 1:length(couches),
        .combine = rbind.data.frame
        
      ) %do% {
        s=1
        resParOccup <- foreach(strate = strates[c(1,2,4,6,7)],
                               .combine = rbind.data.frame
        ) %do% {
          
          print(paste(
            "Je traite ",
            Grandeur[i],
            "occupation",
            strate,
            " pour la couche" ,
            couches[j],"----------------------------"
          ))
          
          
          maskCouche <- Stock_All$no_horizon == couches[j]
          maskStrate <- Stock_All[, strateVar] == strate
          maskNA <- !is.na(Stock_All[, Grandeur[i]] )
          
          if (sum(maskNA & maskCouche & maskStrate) > 30)  {
            resL <-
              samplingDesignStats(grille,
                                  Stock_All[maskNA & maskCouche & maskStrate , c("no_cellule", Grandeur[i]) ], 
                                  Grandeur[i])
            #  elt = Grandeur[i]
            # dataSetSav = dataSet
            #  dataSet = dataSet[maskNA & maskCouche & maskStrate , c("no_cellule", Grandeur[i]) ] 
            
            resL <- as.data.frame(t(resL))
            
          } else {
            resL <- as.data.frame(t(rep(NA,15)))
            colnames(resL) <-  c("n_ind","Min","1stQuart","Median","Mean","3rdQu.","Max",
                                 '1thDec','9thDec',
                                 "Variance" , "se_mean_STSI",
                                 "pcOutliers1.5","Vibrisse1.5","pcOutliers3","Vibrisse3")
            
          }
          
          
          
          cbind.data.frame(elt = GrandeurExplicite[i] ,couche = j, occup = strate , resL)
          
          
        } # fin par occup
        
        resParOccup
        
      } # fin par couche
    resucouche
  } # fin par grandeur
stopCluster(cl)

# On sauve l'objet resufinal en cas de perte par ecrasementdes valeurs
SauvegardeResuFinal <- resufinal

# On ordonne les champs de la table resufinal
resufinal <- resufinal[ , c(1:5 , 11 , 6:9 , 12 , 10 , 13 , 14,15:18)]

# On renomme les champs de la table resufinal
colnames(resufinal) <- c("Grandeur_RMQS" ,
                         "Couche" ,
                         "Occupation" ,
                         "Effectif" ,
                         "Minimum" ,
                         "Premier_Decile" ,
                         "Premier_Quartile" ,
                         "Mediane" ,
                         "Moyenne" ,
                         "Troisieme_Quartile" ,
                         "Neuvieme_Decile" ,
                         "Maximum" ,
                         "Variance" ,
                         "Erreur_standard_STSI",
                         "pcOutliers1.5","Vibrisse1.5","pcOutliers3","Vibrisse3"
)

# Creation de la table xls
setwd(StockDirectory)
write.csv2(resufinal , "Stat_occup_Stock_tot_ETMRMQS18092020_.csv", row.names = FALSE)

kable(resufinal) %>%
  add_header_above(c( "Statistique des stocks ETM (mg/m2) par occupation de sol" = 18))%>%
  kable_styling(bootstrap_options = "striped", "bordered", full_width = F)%>%
  scroll_box(width = "100%", height = "400px")
Statistique des stocks ETM (mg/m2) par occupation de sol
Grandeur_RMQS Couche Occupation Effectif Minimum Premier_Decile Premier_Quartile Mediane Moyenne Troisieme_Quartile Neuvieme_Decile Maximum Variance Erreur_standard_STSI pcOutliers1.5 Vibrisse1.5 pcOutliers3 Vibrisse3
Stock total Cadmium EDTA 1 Culture permanente 59 4.125722 15.551170 25.69607 41.76277 48.64609 59.70541 101.89190 139.7103 1.031030e+03 4.0300000 8.47 109.83890 0.00 139.7103
Stock total Cadmium EDTA 1 Grande culture 864 2.357347 21.900109 30.06454 45.96421 60.27719 72.53482 101.48264 1033.9086 5.125700e+03 2.2900000 4.40 134.46065 2.08 183.9732
Stock total Cadmium EDTA 1 Prairie 509 2.330283 18.039032 25.53477 39.61400 55.85873 63.39270 99.51503 1216.2817 5.911260e+03 3.3400000 6.48 119.73083 2.95 168.8127
Stock total Cadmium EDTA 1 Toute occupation sauf foret 1536 2.330283 18.647504 27.31468 42.27722 57.33511 67.85843 100.72304 1216.2817 5.082000e+03 1.7400000 5.01 127.03489 2.41 183.9732
Stock total Cadmium EDTA 1 Vegetation naturelle 90 2.964243 9.651386 13.25126 25.50497 45.77233 49.32581 96.19143 274.7434 3.020700e+03 5.4400000 10.00 93.47000 6.67 146.1918
Stock total Cadmium HF 1 Culture permanente 59 11.921656 31.603243 58.80555 94.63544 108.06390 143.62681 189.06954 313.7005 4.462680e+03 8.7600000 3.39 256.16789 0.00 313.7005
Stock total Cadmium HF 1 Grande culture 864 17.380621 43.212894 60.53393 98.76518 128.89107 156.18923 235.33344 1766.4990 1.622789e+04 3.9700000 4.86 296.26983 1.97 426.7281
Stock total Cadmium HF 1 Prairie 509 8.706180 35.869060 52.88167 78.11951 112.50206 123.39173 192.86506 3596.3162 3.481401e+04 8.1300000 6.48 226.18495 3.34 331.8238
Stock total Cadmium HF 1 Toute occupation sauf foret 1536 7.075067 37.793577 55.35645 88.16557 120.38569 146.70433 217.56010 3596.3162 2.159020e+04 3.5800000 5.34 281.76784 2.02 416.8914
Stock total Cadmium HF 1 Vegetation naturelle 90 7.940507 17.828598 31.91076 56.36471 97.42995 124.59676 233.58866 546.3982 1.074623e+04 10.1900000 6.67 253.30799 2.22 368.9678
Stock total Cobalt HF 1 Culture permanente 59 1000.677608 2249.318051 3149.42572 4850.19249 5296.56098 7037.68076 8932.18032 13885.7408 7.894492e+06 329.3700000 1.69 11494.44016 0.00 13885.7408
Stock total Cobalt HF 1 Grande culture 864 278.018333 1539.559871 2801.73206 4804.19883 5327.53649 6856.16395 9267.84317 44919.1643 1.463516e+07 122.9900000 3.70 12896.30245 0.81 18148.5041
Stock total Cobalt HF 1 Prairie 509 109.335513 1888.345856 3098.12992 5188.67839 6104.96541 7740.67600 10841.32099 37592.4344 2.052128e+07 199.4100000 3.73 14672.12473 1.38 21485.2750
Stock total Cobalt HF 1 Toute occupation sauf foret 1536 109.335513 1583.710225 2852.77634 4865.48823 5491.24113 7112.38759 9740.79752 44919.1643 1.609938e+07 88.6500000 3.84 13460.41938 1.04 19440.9276
Stock total Cobalt HF 1 Vegetation naturelle 90 397.025333 1226.363920 1890.48651 3459.46289 4033.28038 5405.79666 7716.21420 13883.6250 7.255172e+06 272.8800000 2.22 10656.02580 0.00 13883.6250
Stock total Chrome EDTA 1 Culture permanente 59 1.243404 14.484684 23.73079 39.39718 43.90060 61.00589 74.57792 143.9596 7.518600e+02 3.6500000 1.69 102.68994 0.00 143.9596
Stock total Chrome EDTA 1 Grande culture 864 2.823261 13.636152 21.08523 32.67109 39.10845 49.60732 69.96891 261.8277 7.611400e+02 0.8642523 4.75 92.22492 0.93 133.0533
Stock total Chrome EDTA 1 Prairie 509 2.479668 18.213482 28.42723 42.65084 53.63911 67.07076 92.57732 514.4019 2.190720e+03 2.1100000 3.93 124.92294 1.96 156.2955
Stock total Chrome EDTA 1 Toute occupation sauf foret 1536 1.243404 13.990087 22.99073 36.18522 44.59028 55.19771 82.37144 514.4019 1.359770e+03 0.8876911 4.95 103.42594 1.30 149.8895
Stock total Chrome EDTA 1 Vegetation naturelle 90 2.521620 7.793980 13.25745 27.68602 39.37031 56.42866 86.36474 249.1615 1.445150e+03 3.7900000 2.22 106.82381 1.11 153.7220
Stock total Chrome RMQS1 HF 1 Culture permanente 59 8409.209497 12189.047601 18234.14176 24522.75220 26362.68302 31776.83560 40710.00936 66558.1263 1.489958e+08 1572.1700000 3.39 49068.74040 0.00 66558.1263
Stock total Chrome RMQS1 HF 1 Grande culture 864 3208.285438 9593.594857 16394.32831 25797.00209 27893.67723 34046.70067 42482.51100 1181147.4495 1.761350e+09 1397.4200000 2.20 58959.40376 0.35 83813.5789
Stock total Chrome RMQS1 HF 1 Prairie 508 2681.345587 10879.095220 17791.22663 26729.21133 30663.53892 38205.70920 50076.68808 236463.1375 5.122649e+08 986.3700000 3.94 66649.39573 1.18 98355.8631
Stock total Chrome RMQS1 HF 1 Toute occupation sauf foret 1535 1628.037294 9742.986915 16391.95482 25578.43038 28554.13996 35183.12920 45201.54550 1181147.4495 1.267001e+09 879.6400000 3.06 63054.84840 0.91 87586.3689
Stock total Chrome RMQS1 HF 1 Vegetation naturelle 90 1910.435760 6349.600527 11270.40855 17853.19997 25717.14796 29824.61780 40294.40819 359486.7188 1.661218e+09 4096.3300000 4.44 46266.61514 2.22 64793.6731
Stock total Cuivre EDTA 1 Culture permanente 59 1025.808621 2032.176485 3559.55829 8582.68804 14927.86935 21173.11746 31282.33785 100304.8421 2.993281e+08 1972.3800000 5.08 42037.77667 1.69 60561.3102
Stock total Cuivre EDTA 1 Grande culture 864 112.123284 395.590294 652.46625 1167.87913 2175.62997 1877.97276 3723.75490 90416.7737 2.167034e+07 148.1200000 10.19 3656.21450 6.37 5504.0532
Stock total Cuivre EDTA 1 Prairie 509 42.868487 306.379880 559.23580 1032.36000 1849.71869 1868.97036 3249.93284 47039.4157 1.314052e+07 158.1600000 7.47 3826.74294 4.72 5796.3406
Stock total Cuivre EDTA 1 Toute occupation sauf foret 1536 42.868487 326.296260 602.23654 1119.84528 2545.22180 2002.20522 4565.96843 100304.8421 3.546391e+07 132.9800000 10.87 4099.69884 7.10 6122.5603
Stock total Cuivre EDTA 1 Vegetation naturelle 90 92.131346 165.481312 270.59940 623.62039 1794.50405 1134.71336 3299.57029 35344.6045 2.031673e+07 473.0800000 14.44 2164.87592 10.00 3154.8855
Stock total Cuivre HF 1 Culture permanente 59 5874.193263 8024.867168 12940.08650 24455.76590 36008.45229 53019.70730 69547.83796 152552.9327 9.736974e+08 3677.7200000 3.39 99697.27797 0.00 152552.9327
Stock total Cuivre HF 1 Grande culture 864 1013.736271 2893.510803 4598.67798 7052.80770 9201.96462 10635.20675 15131.35756 216289.4696 1.248605e+08 345.8000000 5.09 19628.91650 3.12 28273.8212
Stock total Cuivre HF 1 Prairie 509 435.992308 2850.974815 4831.02460 7682.95920 9147.11700 11589.45140 16386.92396 74772.5582 5.206143e+07 320.4700000 4.52 21611.99520 1.38 31088.3269
Stock total Cuivre HF 1 Toute occupation sauf foret 1536 318.716667 2791.942395 4667.11059 7399.34057 10208.92834 11417.66727 17489.86607 216289.4696 1.587101e+08 291.2300000 6.71 21272.43940 3.71 31599.6543
Stock total Cuivre HF 1 Vegetation naturelle 90 397.025333 1747.935708 3070.55668 5771.79774 8825.05160 10006.79342 18891.79978 67489.0900 1.070938e+08 1094.1300000 7.78 20555.86478 4.44 25610.9707
Stock total Molybdene HF 1 Culture permanente 59 90.414124 150.807595 227.64554 300.08452 414.08764 440.31419 683.26954 1907.2464 1.266157e+05 48.0100000 6.78 746.63022 6.78 746.6302
Stock total Molybdene HF 1 Grande culture 864 29.266599 112.980436 195.95981 281.41089 336.78792 386.87563 563.90055 3963.0574 7.893958e+04 9.1400000 6.25 670.70309 3.12 956.1433
Stock total Molybdene HF 1 Prairie 509 22.304445 144.615619 220.98736 315.56688 393.38614 450.41130 699.74039 3110.0726 1.052180e+05 14.1400000 7.66 793.32653 2.55 1135.5337
Stock total Molybdene HF 1 Toute occupation sauf foret 1536 22.304445 124.584557 202.88066 292.78622 363.56736 407.66050 611.26206 3963.0574 1.092007e+05 8.0400000 7.23 714.74314 3.91 1019.4917
Stock total Molybdene HF 1 Vegetation naturelle 90 24.890590 96.578952 149.77204 234.61261 434.12135 404.19044 809.88887 3923.9812 4.100332e+05 70.2500000 10.00 785.88252 6.67 1136.5337
Stock total Plomb EDTA 1 Culture permanente 59 390.977412 800.892506 1591.74009 2574.35947 3234.87824 4055.73484 6587.96388 10971.9977 5.424344e+06 302.8900000 6.78 7248.29583 0.00 10971.9977
Stock total Plomb EDTA 1 Grande culture 864 123.570628 874.962868 1364.18620 2012.29878 2693.21635 2982.41835 4317.64581 57143.1758 1.435340e+07 122.4200000 5.56 5408.50031 3.36 7616.9268
Stock total Plomb EDTA 1 Prairie 509 140.835291 858.411751 1465.62642 2347.84470 2907.94944 3457.25252 4784.06699 50770.7672 1.136706e+07 146.0000000 4.91 6395.15930 1.96 9364.7736
Stock total Plomb EDTA 1 Toute occupation sauf foret 1536 121.407456 835.619917 1367.22899 2097.93680 2791.41697 3214.32863 4622.41957 57143.1758 1.364693e+07 89.2600000 5.40 5985.76378 2.73 8679.8329
Stock total Plomb EDTA 1 Vegetation naturelle 90 121.407456 572.977264 1008.18015 1770.92280 2311.26906 2667.11082 4929.24528 15499.1747 4.957495e+06 221.3600000 8.89 5111.58440 2.22 7058.6638
Stock total Plomb HF 1 Culture permanente 59 2675.309303 6075.997345 11186.55141 16053.02360 16143.47000 20652.29255 23916.06335 37552.4264 5.337572e+07 929.8800000 3.39 28459.63480 0.00 37552.4264
Stock total Plomb HF 1 Grande culture 864 1201.486726 5870.608988 9014.80945 12432.91262 13851.93973 16394.39838 21847.69668 150073.9760 8.792232e+07 295.9000000 4.17 27438.38672 1.39 37294.0893
Stock total Plomb HF 1 Prairie 509 1895.877789 6465.066608 10332.64520 14279.55653 16587.90784 19027.13848 26649.64099 214497.8450 1.980525e+08 613.9300000 6.09 31583.05295 1.77 42803.6816
Stock total Plomb HF 1 Toute occupation sauf foret 1536 1201.486726 5891.588835 9129.78971 13038.78417 14757.71574 17264.52139 23815.19283 214497.8450 1.376464e+08 272.5400000 4.95 29462.13080 1.43 41120.8561
Stock total Plomb HF 1 Vegetation naturelle 90 1267.157303 3802.578913 6264.84448 8489.51600 10761.79734 12300.10586 19914.13849 47684.1523 6.164617e+07 785.5800000 8.89 19969.38489 3.33 28813.0188
Stock total Zinc EDTA 1 Culture permanente 59 113.775021 421.273870 623.16319 1136.95748 1646.83774 1818.69595 3369.51527 12996.3580 3.999035e+06 244.8700000 8.47 3579.66121 3.39 5326.2932
Stock total Zinc EDTA 1 Grande culture 864 98.978549 338.297157 489.87638 747.66753 1190.87379 1218.98879 2004.83390 94353.7178 1.214193e+07 115.5100000 7.75 2305.87576 2.78 3406.7599
Stock total Zinc EDTA 1 Prairie 509 87.673350 325.708172 489.56822 758.17160 1195.23247 1214.45471 2109.75653 48632.7083 6.554955e+06 112.9100000 8.45 2294.32372 3.93 2993.6444
Stock total Zinc EDTA 1 Toute occupation sauf foret 1536 87.673350 331.474461 493.18378 759.34148 1212.93693 1225.81809 2085.30210 94353.7178 9.400537e+06 77.1400000 8.27 2321.82433 3.65 3411.5323
Stock total Zinc EDTA 1 Vegetation naturelle 90 111.639060 268.829344 497.23469 717.11018 1114.06265 1128.81882 2082.57226 8801.9632 1.898698e+06 136.7100000 8.89 2085.73884 7.78 2393.9346
Stock total Zinc HF 1 Culture permanente 59 15319.087491 18227.737991 24082.38318 32436.48301 36942.81691 44607.82015 59489.54881 104208.1981 3.614133e+08 2472.2600000 5.08 71847.63333 0.00 104208.1981
Stock total Zinc HF 1 Grande culture 864 5134.264724 14656.482817 20853.42381 30363.58138 33799.43474 40932.87151 53466.31634 623538.2992 7.685910e+08 904.6900000 3.59 71036.97675 0.93 93355.3358
Stock total Zinc HF 1 Prairie 509 2440.726461 16418.620243 23917.60342 34613.74720 38989.14231 47365.56797 60977.60739 646923.1888 1.157353e+09 1507.5900000 3.14 80471.98917 0.59 111037.1620
Stock total Zinc HF 1 Toute occupation sauf foret 1536 1768.766667 15012.798333 21449.65629 31379.04293 35633.86026 43134.90885 57415.01668 646923.1888 9.127310e+08 761.1500000 3.78 75065.15200 0.85 104208.1981
Stock total Zinc HF 1 Vegetation naturelle 90 6684.732400 11767.364584 15232.40790 25272.00021 34212.29814 41706.42493 55740.42017 279695.2383 1.264904e+09 3701.8900000 4.44 76571.99200 2.22 87910.0186

Statistique descriptive du stocks totaux par domaine geologique

# Importation des donnees sources
files.Rdata <- list.files(StockDirectory,pattern = paste0("Stock",".*",".RData$"))


for(i in 1:length(files.Rdata)){
 
  setwd(StockDirectory)
  
  Stock1 <- get(load(files.Rdata[i]))
  
  if(i==1){
    
    Stock_All <- Stock1
    
  }else{
    
    Stock_All <- left_join(Stock_All,Stock1[,c(1,ncol(Stock1))],by=c("id_site"))
    
  }
  
  
}

Stock_All <- as.data.frame(Stock_All)

tmp <- Stock_All
tmp$domaine_geo <- 'TtesGeol'
Stock_All <- rbind.data.frame(Stock_All , tmp)
rm(tmp)

levels(Stock_All$domaine_geo)[nlevels(Stock_All$domaine_geo)] <- c("Toute_geol")

# Définition de la variables de regroupement pour les tables finales
strateVar <- "domaine_geo"
Stock_All$domaine_geo <- as.factor(Stock_All$domaine_geo)
levels(Stock_All$domaine_geo) <- c("Cristallin","Inconnu","Sedimentaire","Tourbiere","Tout domaine","Volcanique")

strates <- levels(Stock_All[, strateVar])
Stock_All$no_horizon <- 1

couches <- 1

# Jointure du numéro de cellule
Stock_All <- left_join(Stock_All,no_cellule[,c(9,10)],by=c("id_site"))
Stock_All <- Stock_All[-which(duplicated(Stock_All)),]
colnames(Stock_All)[ncol(Stock_All)] <- "no_cellule"

#setup parallel backend to use many processors
cores = detectCores()
cl <- makeCluster(3) #not to overload your computer
registerDoParallel(cl)

# #setup parallel backend to use many processors
# cores = detectCores()
# cl <- makeCluster(2) #not to overload your computer
# registerDoParallel(cl)

resufinal    <-
  foreach(
    i = 1:length(Grandeur) ,#31:33 ,#
    .combine = rbind.data.frame,
    .export = "samplingDesignStats",
    .packages = c("sp", "spcosa", "foreach"),
    .verbose=FALSE
  ) %dopar% {
    
    
    resucouche <- 
      foreach(
        j = 1:length(couches),
        .combine = rbind.data.frame
        
      ) %do% {
        s=1
        resParOccup <- foreach(strate = strates[c(1,2,3,5,6)],
                               .combine = rbind.data.frame
        ) %do% {
          
          print(paste(
            "Je traite ",
            Grandeur[i],
            "domaine_geo",
            strate,
            " pour la couche" ,
            couches[j],"----------------------------"
          ))
          
          
          maskCouche <- Stock_All$no_horizon == couches[j]
          maskStrate <- Stock_All[, strateVar] == strate
          maskNA <- !is.na(Stock_All[, Grandeur[i]] )
          
          if (sum(maskNA & maskCouche & maskStrate) > 30)  {
            resL <-
              samplingDesignStats(grille,
                                  Stock_All[maskNA & maskCouche & maskStrate , c("no_cellule", Grandeur[i]) ], 
                                  Grandeur[i])
            #  elt = Grandeur[i]
            # dataSetSav = dataSet
            #  dataSet = dataSet[maskNA & maskCouche & maskStrate , c("no_cellule", Grandeur[i]) ] 
            
            resL <- as.data.frame(t(resL))
            
          } else {
            resL <- as.data.frame(t(rep(NA,15)))
            colnames(resL) <-  c("n_ind","Min","1stQuart","Median","Mean","3rdQu.","Max",
                                 '1thDec','9thDec',
                                 "Variance" , "se_mean_STSI",
                                 "pcOutliers1.5","Vibrisse1.5","pcOutliers3","Vibrisse3")
            
          }
          
          
          
          cbind.data.frame(elt = GrandeurExplicite[i] ,couche = couches[j], occup = strate , resL)
          
          
        } # fin par occup
        
        resParOccup
        
      } # fin par couche
    resucouche
  } # fin par grandeur
stopCluster(cl)

# On sauve l'objet resufinal en cas de perte par écrasementdes valeurs
SauvegardeResuFinal <- resufinal

# On ordonne les champs de la table resufinal
resufinal <- resufinal[ , c(1:5 , 11 , 6:9 , 12 , 10 , 13 , 14,15:18)]

# On renomme les champs de la table resufinal
colnames(resufinal) <- c("Grandeur_RMQS" ,
                         "Couche" ,
                         "Domaine geol" ,
                         "Effectif" ,
                         "Minimum" ,
                         "Premier_Decile" ,
                         "Premier_Quartile" ,
                         "Mediane" ,
                         "Moyenne" ,
                         "Troisieme_Quartile" ,
                         "Neuvieme_Decile" ,
                         "Maximum" ,
                         "Variance" ,
                         "Erreur_standard_STSI",
                         "pcOutliers1.5","Vibrisse1.5","pcOutliers3","Vibrisse3"
)

# Creation de la table xls
resufinal <- na.omit(resufinal)
setwd(StockDirectory)
write.csv2(resufinal , "Stat_geol_Stock_tot_ETMRMQS18092020_.csv", row.names = FALSE)

kable(resufinal) %>%
  add_header_above(c( "Statistique des stocks ETM (mg/m2) par domaine geologique" = 19))%>%
  kable_styling(bootstrap_options = "striped", "bordered", full_width = F)%>%
scroll_box(width = "100%", height = "400px")
Statistique des stocks ETM (mg/m2) par domaine geologique
Grandeur_RMQS Couche Domaine geol Effectif Minimum Premier_Decile Premier_Quartile Mediane Moyenne Troisieme_Quartile Neuvieme_Decile Maximum Variance Erreur_standard_STSI pcOutliers1.5 Vibrisse1.5 pcOutliers3 Vibrisse3
1 Stock total Cadmium EDTA 1 Cristallin 313 3.9989508 12.781617 17.95499 24.45503 27.59363 32.57603 44.52485 155.2103 2.645000e+02 8.122741e-01 4.79 54.08841 2.24 71.07806
2 Stock total Cadmium EDTA 1 Inconnu 32 5.4739805 8.101886 15.56010 27.35850 35.79023 40.32942 68.69351 146.3669 1.142650e+03 5.950000e+00 6.25 70.82124 6.25 70.82124
3 Stock total Cadmium EDTA 1 Sedimentaire 1309 2.3302833 21.607837 32.07823 49.99429 66.21804 76.44600 115.02100 1216.2817 6.084440e+03 2.080000e+00 5.81 142.99698 2.83 209.03843
4 Stock total Cadmium EDTA 1 Tout domaine 1683 2.3302833 16.959783 26.39146 41.97102 57.78189 68.68711 104.80991 1216.2817 5.054430e+03 1.630000e+00 5.76 129.73072 2.67 192.87670
6 Stock total Cadmium HF 1 Cristallin 313 4.4131278 26.469267 37.21533 50.86425 57.38985 68.27811 92.49688 288.1965 1.126540e+03 1.810000e+00 4.79 111.24720 1.92 135.38480
7 Stock total Cadmium HF 1 Inconnu 32 8.0222128 17.036503 23.27734 52.50760 67.20068 83.92248 132.23984 291.3307 4.080850e+03 4.630000e+00 6.25 133.73761 3.12 246.36137
8 Stock total Cadmium HF 1 Sedimentaire 1309 4.4518199 40.089391 62.75893 103.20555 136.20667 160.77204 247.25676 3596.3162 2.530592e+04 4.220000e+00 5.35 307.73334 2.52 450.38046
9 Stock total Cadmium HF 1 Tout domaine 1683 4.4131278 34.054113 52.91812 85.85400 119.14266 146.11333 221.98771 3596.3162 2.099939e+04 3.210000e+00 5.41 285.35808 2.14 420.71685
11 Stock total Cobalt HF 1 Cristallin 313 30.5634094 1339.932693 2204.74827 3902.07500 4665.93466 5962.02677 8285.74993 44919.1643 1.520392e+07 2.195600e+02 3.83 11531.77567 0.96 16303.32913
12 Stock total Cobalt HF 1 Inconnu 32 64.0198403 279.956853 704.66090 2502.86242 3578.10801 5025.25035 7787.98533 13883.6250 1.319755e+07 5.734500e+02 6.25 10525.14686 0.00 13883.62500
13 Stock total Cobalt HF 1 Sedimentaire 1309 6.3056939 1498.365034 2747.21468 4742.15893 5290.39851 7056.78611 9459.01792 33869.2661 1.349470e+07 9.006000e+01 3.06 13460.41938 0.84 18148.50411
14 Stock total Cobalt HF 1 Tout domaine 1683 6.3056939 1413.034291 2549.02326 4559.49722 5245.21844 6936.19803 9456.74788 44919.1643 1.580662e+07 9.130000e+01 3.57 13460.41938 0.89 20077.70494
16 Stock total Chrome EDTA 1 Cristallin 313 0.7426623 13.210388 24.16000 38.42818 46.12779 58.20287 80.04609 263.5351 1.228630e+03 1.660000e+00 4.79 102.93589 1.60 149.88946
17 Stock total Chrome EDTA 1 Inconnu 32 5.4490498 7.940649 21.29203 40.91753 52.55094 64.77952 92.59565 249.1615 2.315330e+03 8.840000e+00 3.12 133.06462 3.12 133.06462
18 Stock total Chrome EDTA 1 Sedimentaire 1309 0.6305694 14.801910 23.02846 36.78992 46.37584 56.79845 87.14055 514.4019 1.560100e+03 1.060000e+00 5.81 107.19878 1.68 157.03956
19 Stock total Chrome EDTA 1 Tout domaine 1683 0.6305694 14.016645 23.02388 36.84230 46.21482 56.97129 86.38377 514.4019 1.499250e+03 9.041181e-01 5.53 107.57127 1.54 158.39212
21 Stock total Chrome RMQS1 HF 1 Cristallin 313 147.1042602 7534.564672 12119.45164 20757.30066 25796.59620 29929.11888 37985.81623 1181147.4495 4.447744e+09 3.723470e+03 1.92 54814.20640 0.32 77079.87200
22 Stock total Chrome RMQS1 HF 1 Inconnu 32 1628.0372939 3268.123028 4407.87791 14454.10954 26291.69299 24739.58158 32389.36612 359486.7188 3.836724e+09 1.120414e+04 3.12 44534.77913 3.12 44534.77913
23 Stock total Chrome RMQS1 HF 1 Sedimentaire 1308 75.6683263 9230.490921 16290.95503 25233.26650 27174.49518 35177.96471 45755.80476 236463.1375 2.864512e+08 4.497100e+02 2.52 63054.84840 0.54 87586.36891
24 Stock total Chrome RMQS1 HF 1 Tout domaine 1682 75.6683263 8413.474957 14918.48796 24329.35881 27339.46789 34037.91931 44361.48896 1181147.4495 1.181885e+09 8.282700e+02 2.97 62450.02133 0.83 87586.36891
26 Stock total Cuivre EDTA 1 Cristallin 313 42.8684868 189.361654 372.50154 694.50360 1107.73789 1317.24539 2056.28928 12924.5355 2.290318e+06 8.542000e+01 5.43 2699.46230 3.51 3743.70289
27 Stock total Cuivre EDTA 1 Inconnu 32 81.7797985 149.071704 235.22684 725.05010 1614.53621 1555.46422 1955.52279 15804.7201 9.946262e+06 5.708700e+02 6.25 2850.80132 6.25 2850.80132
28 Stock total Cuivre EDTA 1 Sedimentaire 1309 27.4928252 324.812581 601.03078 1148.51619 2738.60643 2121.48932 4934.70510 100304.8421 4.081660e+07 1.535000e+02 11.61 4312.83804 7.56 6588.11217
29 Stock total Cuivre EDTA 1 Tout domaine 1683 27.4928252 285.357145 534.33271 1038.45865 2383.60299 1907.28455 4258.37274 100304.8421 3.281088e+07 1.244300e+02 10.40 3895.05584 6.83 6026.11420
31 Stock total Cuivre HF 1 Cristallin 313 164.2426206 2305.746970 3767.93395 6879.02693 8042.50820 11156.76800 15001.52342 31551.9708 3.089277e+07 2.946200e+02 2.88 20749.06275 0.00 31551.97082
32 Stock total Cuivre HF 1 Inconnu 32 463.2131292 730.955347 2175.44036 3918.07128 6689.30598 8455.77621 14599.80180 38004.7792 6.661682e+07 1.362200e+03 6.25 17199.28707 3.12 27944.28498
33 Stock total Cuivre HF 1 Sedimentaire 1309 71.7587961 2477.128437 4306.78549 7015.77241 10164.45354 11019.08650 17730.23910 216289.4696 1.820013e+08 3.323600e+02 7.33 20664.67421 4.51 30828.62434
34 Stock total Cuivre HF 1 Tout domaine 1683 71.7587961 2389.572942 4144.35490 6976.60886 9696.17037 11022.12266 17071.13634 216289.4696 1.499403e+08 2.687300e+02 6.36 21272.43940 3.51 31599.65426
36 Stock total Molybdene HF 1 Cristallin 313 5.7841966 102.394398 184.84891 267.63424 341.35913 372.59832 525.64708 3923.9812 1.421251e+05 2.100000e+01 6.71 617.55080 3.51 928.85800
37 Stock total Molybdene HF 1 Inconnu 32 37.6841250 57.734008 83.88618 175.90051 209.01522 282.54163 325.53741 832.4555 2.831602e+04 2.474000e+01 3.12 552.34482 0.00 832.45551
38 Stock total Molybdene HF 1 Sedimentaire 1309 5.0697779 114.173982 192.91963 288.72060 359.09760 408.70311 602.97425 4220.3441 1.083876e+05 8.590000e+00 6.49 725.90656 3.51 1053.76091
39 Stock total Molybdene HF 1 Tout domaine 1683 5.0697779 109.788138 189.99072 286.19639 355.41306 404.25690 600.09802 4220.3441 1.134374e+05 7.690000e+00 6.65 725.03371 3.39 1044.72660
41 Stock total Plomb EDTA 1 Cristallin 313 323.2880273 714.145930 1047.34336 1513.96026 1878.26702 2104.56119 3256.78869 15513.5624 2.470749e+06 8.393000e+01 6.71 3672.95280 3.19 5084.69568
42 Stock total Plomb EDTA 1 Inconnu 32 316.0448869 644.195843 1492.38066 2091.42253 3608.96297 2780.33436 4019.55456 46794.7066 6.427442e+07 1.386840e+03 9.38 4090.93137 6.25 5159.05683
43 Stock total Plomb EDTA 1 Sedimentaire 1309 89.3092402 965.074869 1562.20744 2364.57137 3041.95905 3452.49516 5102.86606 57143.1758 1.405538e+07 9.962000e+01 6.42 6284.17039 2.98 9058.13182
44 Stock total Plomb EDTA 1 Tout domaine 1683 89.3092402 847.170416 1375.87830 2104.66250 2798.43848 3227.91939 4684.50695 57143.1758 1.286525e+07 8.143000e+01 5.82 5985.76378 2.61 8766.02316
46 Stock total Plomb HF 1 Cristallin 313 575.5632703 6049.187975 8499.81953 12152.62560 13691.96634 16282.74390 21474.98049 74626.3200 7.626244e+07 4.791700e+02 4.47 27891.34210 2.24 36502.49590
47 Stock total Plomb HF 1 Inconnu 32 1710.6609375 3159.682985 5257.02236 9284.60926 15537.80103 15185.19926 22503.75951 161809.0198 7.693247e+08 4.700150e+03 6.25 28007.67763 3.12 32708.69833
48 Stock total Plomb HF 1 Sedimentaire 1309 563.7290308 5690.941866 8954.64819 12905.11650 14585.24297 17209.01700 23807.52078 214497.8450 1.309614e+08 2.980000e+02 4.66 29520.52787 1.22 41120.85615
49 Stock total Plomb HF 1 Tout domaine 1683 563.7290308 5588.903738 8558.29977 12541.24717 14312.61213 17039.87555 23287.87521 214497.8450 1.315790e+08 2.399600e+02 4.40 29593.91583 1.25 42320.26113
51 Stock total Zinc EDTA 1 Cristallin 313 87.6733500 291.681766 406.91592 595.55472 821.01171 952.03485 1516.30741 5374.0896 5.753318e+05 4.210000e+01 7.03 1740.74710 3.83 2501.92552
52 Stock total Zinc EDTA 1 Inconnu 32 155.2979186 339.657864 511.74989 679.56693 1333.35829 1116.03699 1828.06448 15132.2601 6.697846e+06 4.554800e+02 9.38 1834.15503 3.12 2838.36051
53 Stock total Zinc EDTA 1 Sedimentaire 1309 96.7487692 352.128658 521.33419 798.78291 1292.17580 1276.49309 2202.36392 94353.7178 1.085253e+07 8.820000e+01 8.63 2406.57603 3.97 3500.77901
54 Stock total Zinc EDTA 1 Tout domaine 1683 87.6733500 334.361826 493.98854 756.44071 1198.51815 1219.30413 2083.24789 94353.7178 8.710847e+06 6.997000e+01 8.26 2305.87576 3.74 3373.52440
56 Stock total Zinc HF 1 Cristallin 313 825.4976929 14819.217200 21520.34267 29929.51496 31755.67237 40931.11300 50577.33470 87839.0260 2.058327e+08 7.550200e+02 1.60 65677.17652 0.00 87839.02601
57 Stock total Zinc HF 1 Inconnu 32 2527.6722104 4699.826568 10781.52106 22612.65052 24183.04500 32248.66735 48003.65816 73760.2965 3.108414e+08 2.261410e+03 3.12 58327.53872 0.00 73760.29645
58 Stock total Zinc HF 1 Sedimentaire 1309 692.3651854 13034.881200 20216.90223 30786.76267 35338.18445 42886.16400 58532.17888 646923.1888 1.057430e+09 8.385800e+02 3.97 76571.99200 1.07 104208.19813
59 Stock total Zinc HF 1 Tout domaine 1683 692.3651854 13256.711183 20433.74352 30505.31020 34502.71504 42029.99226 56533.63622 646923.1888 8.762037e+08 6.943000e+02 3.86 74212.28733 0.83 104208.19813

Statistiques descriptives par region

# Importation des donnees sources
files.Rdata <- list.files(StockDirectory,pattern = paste0("Stock",".*",".RData$"))


for(i in 1:length(files.Rdata)){
 
  setwd(StockDirectory)
  
  Stock1 <- get(load(files.Rdata[i]))
  
  if(i==1){
    
    Stock_All <- Stock1
    
  }else{
    
    Stock_All <- left_join(Stock_All,Stock1[,c(1,ncol(Stock1))],by=c("id_site"))
    
  }
  
  
}

Stock_All <- as.data.frame(Stock_All)
Stock_All <- dplyr::left_join(Stock_All,no_cellule[,c("id_site","code_dept")],by=c("id_site"))
Stock_All <- Stock_All[-which(duplicated(Stock_All)),]

Stock_All$Region <- ifelse(Stock_All$code_dept%in%c("29 ","22 ","56 ","35 "),"Bretagne",
                        ifelse(Stock_All$code_dept%in%c("50 ","14 ","76 ","27 ","61 "),"Normandie",
                               ifelse(Stock_All$code_dept%in%c("62 ","59 ","80 ","60 ","02 "),"Haut de France",
                                      ifelse(Stock_All$code_dept%in%c("53 ","72 ","49 ","44 ","85 "),"Pays de la Loire",
                                      ifelse(Stock_All$code_dept%in%c("95 ","78 ","91 ","77 ","75 ","93 ","92 ","94 "),"Ile de France",
                                             ifelse(Stock_All$code_dept%in%c("28 ","45 ","41 ","37 ","36 ","18 "),"Centre val de Loire",
                                                    ifelse(Stock_All$code_dept%in%c("79 ","86 ","87 ","23 ","19 ","17 ","16 ","24 ","33 ","47 ","40 ","64 "),
                                                           "Nouvelle Aquitaine",
                                                           ifelse(Stock_All$code_dept%in%c("08 ","51 ","10 ","55 ","52 ","57 ","54 ","88 ","67 ","68 "),
                                                                  "Grand Est",
                                                                  ifelse(Stock_All$code_dept%in%c("89 ","58 ","21 ","71 ","70 ","39 ","25 ","90 "),
                                                                         "Bourgogne Franche Comte",
                                                                         ifelse(Stock_All$code_dept%in%c("03 ","63 ","15 ","43 ","42 ","69 ","07 ","01 ",
                                                                                                      "26 ","38 ","74 ","73 "),"Auvergne Rhone Alpes",
                                                                                ifelse(Stock_All$code_dept%in%c("46 ","12 ","48 ","30 ","34 ","81 ",
                                                                                                             "82 ","31 ","32 ","65 ","09 ","11 ","66 "),
                                                                                       "Occitanie",
                                                                                       ifelse(Stock_All$code_dept%in%c("84 ","05 ","04 ","06 ","83 ","13 "),
                                                                                              "Provence Alpes Cote D'azur",
                                                                                              ifelse(Stock_All$code_dept%in%c("2A ","2B "),"Corse",NA)))))))))))))



tmp <- Stock_All
tmp$Region <- 'France entiere'
Stock_All <- rbind.data.frame(Stock_All , tmp)
rm(tmp)

levels(Stock_All$Region)[nlevels(Stock_All$Region)] <- c("France entiere")

# Définition de la variables de regroupement pour les tables finales
strateVar <- "Region"
Stock_All$Region <- as.factor(Stock_All$Region)

strates <- levels(Stock_All[, strateVar])
Stock_All$no_horizon <- 1

couches <- 1

# Jointure du numéro de cellule
Stock_All <- left_join(Stock_All,no_cellule[,c(9,10)],by=c("id_site"))
Stock_All <- Stock_All[-which(duplicated(Stock_All)),]
colnames(Stock_All)[ncol(Stock_All)] <- "no_cellule"

#setup parallel backend to use many processors
cores = detectCores()
cl <- makeCluster(3) #not to overload your computer
registerDoParallel(cl)

# #setup parallel backend to use many processors
# cores = detectCores()
# cl <- makeCluster(2) #not to overload your computer
# registerDoParallel(cl)

resufinal    <-
  foreach(
    i = 1:length(Grandeur) ,#31:33 ,#
    .combine = rbind.data.frame,
    .export = "samplingDesignStats",
    .packages = c("sp", "spcosa", "foreach"),
    .verbose=FALSE
  ) %dopar% {
    
    
    resucouche <- 
      foreach(
        j = 1:length(couches),
        .combine = rbind.data.frame
        
      ) %do% {
        s=1
        resParOccup <- foreach(strate = strates,
                               .combine = rbind.data.frame
        ) %do% {
          
          print(paste(
            "Je traite ",
            Grandeur[i],
            "domaine_geo",
            strate,
            " pour la couche" ,
            couches[j],"----------------------------"
          ))
          
          
          maskCouche <- Stock_All$no_horizon == couches[j]
          maskStrate <- Stock_All[, strateVar] == strate
          maskNA <- !is.na(Stock_All[, Grandeur[i]] )
          
          if (sum(maskNA & maskCouche & maskStrate) > 30)  {
            resL <-
              samplingDesignStats(grille,
                                  Stock_All[maskNA & maskCouche & maskStrate , c("no_cellule", Grandeur[i]) ], 
                                  Grandeur[i])
            #  elt = Grandeur[i]
            # dataSetSav = dataSet
            #  dataSet = dataSet[maskNA & maskCouche & maskStrate , c("no_cellule", Grandeur[i]) ] 
            
            resL <- as.data.frame(t(resL))
            
          } else {
            resL <- as.data.frame(t(rep(NA,15)))
            colnames(resL) <-  c("n_ind","Min","1stQuart","Median","Mean","3rdQu.","Max",
                                 '1thDec','9thDec',
                                 "Variance" , "se_mean_STSI",
                                 "pcOutliers1.5","Vibrisse1.5","pcOutliers3","Vibrisse3")
            
          }
          
          
          
          cbind.data.frame(elt = GrandeurExplicite[i] ,couche = couches[j], occup = strate , resL)
          
          
        } # fin par occup
        
        resParOccup
        
      } # fin par couche
    resucouche
  } # fin par grandeur
stopCluster(cl)

# On sauve l'objet resufinal en cas de perte par écrasementdes valeurs
SauvegardeResuFinal <- resufinal

# On ordonne les champs de la table resufinal
resufinal <- resufinal[ , c(1:5 , 11 , 6:9 , 12 , 10 , 13 , 14,15:18)]

# On renomme les champs de la table resufinal
colnames(resufinal) <- c("Grandeur_RMQS" ,
                         "Couche" ,
                         "Region" ,
                         "Effectif" ,
                         "Minimum" ,
                         "Premier_Decile" ,
                         "Premier_Quartile" ,
                         "Mediane" ,
                         "Moyenne" ,
                         "Troisieme_Quartile" ,
                         "Neuvieme_Decile" ,
                         "Maximum" ,
                         "Variance" ,
                         "Erreur_standard_STSI",
                         "pcOutliers1.5","Vibrisse1.5","pcOutliers3","Vibrisse3"
)

# Creation de la table xls
resufinal <- na.omit(resufinal)
setwd(StockDirectory)
write.csv2(resufinal , "Stat_region_Stock_tot_ETMRMQS18092020_.csv", row.names = FALSE)

kable(resufinal) %>%
  add_header_above(c( "Statistique des stocks ETM (mg/m2) par region" = 19))%>%
  kable_styling(bootstrap_options = "striped", "bordered", full_width = F)%>%
scroll_box(width = "100%", height = "400px")
Statistique des stocks ETM (mg/m2) par region
Grandeur_RMQS Couche Region Effectif Minimum Premier_Decile Premier_Quartile Mediane Moyenne Troisieme_Quartile Neuvieme_Decile Maximum Variance Erreur_standard_STSI pcOutliers1.5 Vibrisse1.5 pcOutliers3 Vibrisse3
1 Stock total Cadmium EDTA 1 Auvergne Rhone Alpes 222 5.550854e+00 15.418083 22.11181 32.85589 44.92847 53.31763 88.15434 227.8665 1.460820e+03 2.280000 7.66 97.43808 3.15 146.19180
2 Stock total Cadmium EDTA 1 Bourgogne Franche Comte 133 5.337040e+00 23.704711 37.33545 55.98297 84.34368 88.05789 154.54566 1216.2817 1.422397e+04 10.030000 9.77 155.64294 4.51 233.48458
3 Stock total Cadmium EDTA 1 Bretagne 107 1.052459e+01 17.496341 22.27319 26.98086 31.79325 36.68996 49.05908 155.2103 3.390700e+02 1.590000 5.61 56.58548 2.80 75.43579
4 Stock total Cadmium EDTA 1 Centre val de Loire 120 4.967508e+00 17.832109 28.20919 40.57518 48.86269 60.09039 91.32618 294.7506 1.228570e+03 2.910000 3.33 103.73970 0.83 123.33891
6 Stock total Cadmium EDTA 1 France entiere 1683 2.330283e+00 16.959783 26.39146 41.97102 57.78189 68.68711 104.80991 1216.2817 5.054430e+03 1.660000 5.76 129.73072 2.67 192.87670
7 Stock total Cadmium EDTA 1 Grand Est 165 7.676721e+00 26.283475 40.85593 54.38829 63.28832 76.80076 112.06888 250.5844 1.461820e+03 2.960000 6.06 124.75203 1.82 153.74899
8 Stock total Cadmium EDTA 1 Haut de France 109 3.654633e+01 58.681938 70.58970 88.07144 101.16829 110.99195 127.25921 1001.2616 8.715500e+03 7.940000 3.67 164.44249 1.83 192.87670
9 Stock total Cadmium EDTA 1 Ile de France 39 1.571234e+01 27.852365 36.10176 57.03351 89.68199 75.83248 103.18323 986.3555 2.475623e+04 24.580000 10.26 94.00138 5.13 146.36687
10 Stock total Cadmium EDTA 1 Normandie 114 3.935199e+00 22.100154 30.09551 41.79345 51.34070 62.38800 79.25253 291.9800 1.551470e+03 3.460000 4.39 103.46763 2.63 139.51148
11 Stock total Cadmium EDTA 1 Nouvelle Aquitaine 230 3.299297e+00 14.610323 23.86915 35.45740 54.04145 64.87428 101.54409 555.8309 3.497770e+03 3.740000 6.09 119.83362 2.61 168.81265
12 Stock total Cadmium EDTA 1 Occitanie 214 3.998951e+00 13.829546 22.83575 39.66342 65.28217 64.84693 129.05038 1033.9086 1.056294e+04 6.970000 10.28 127.46291 5.14 184.65885
13 Stock total Cadmium EDTA 1 Pays de la Loire 114 9.876922e+00 20.379093 25.36829 34.01998 39.50310 44.68967 59.29259 201.0140 5.935500e+02 1.920000 6.14 73.28807 1.75 98.47787
14 Stock total Cadmium EDTA 1 Provence Alpes Cote D’azur 90 1.031738e+01 22.305224 31.48847 44.49473 52.51896 63.56878 89.61985 257.9022 1.411630e+03 4.110000 5.56 99.32625 2.22 138.28833
15 Stock total Cadmium HF 1 Auvergne Rhone Alpes 222 1.456966e+01 36.448655 48.69528 75.00917 95.05728 111.13138 164.10016 491.7550 5.662970e+03 4.780000 7.21 197.84380 2.25 268.13586
16 Stock total Cadmium HF 1 Bourgogne Franche Comte 133 2.186465e+01 44.911723 73.69906 117.74304 187.22759 196.73633 321.81262 3596.3162 1.098298e+05 27.800000 9.02 343.02189 2.26 532.92192
17 Stock total Cadmium HF 1 Bretagne 107 1.738062e+01 35.302291 46.36642 54.37233 62.71935 71.08862 90.22443 288.1965 1.131160e+03 2.810000 5.61 103.20442 2.80 143.88242
18 Stock total Cadmium HF 1 Centre val de Loire 120 1.176579e+01 25.878268 45.91769 78.76878 99.54412 131.46303 188.24798 478.9697 5.440820e+03 5.550000 3.33 254.04107 0.83 316.55693
20 Stock total Cadmium HF 1 France entiere 1683 4.413128e+00 34.054113 52.91812 85.85400 119.14266 146.11333 221.98771 3596.3162 2.099939e+04 3.280000 5.41 285.35808 2.14 420.71685
21 Stock total Cadmium HF 1 Grand Est 165 9.222114e+00 56.018859 79.22662 128.79305 144.57980 182.98717 264.05902 588.1707 8.882740e+03 6.640000 3.64 319.31995 1.21 445.57027
22 Stock total Cadmium HF 1 Haut de France 109 6.544192e+01 117.067063 145.68592 167.75193 196.35733 204.43658 275.29481 1407.9960 1.935998e+04 10.510000 9.17 278.73547 4.59 369.96742
23 Stock total Cadmium HF 1 Ile de France 39 3.317142e+01 50.025185 77.40074 112.69029 163.54720 162.87837 257.99960 1327.2083 4.493435e+04 32.910000 10.26 249.66684 5.13 301.72301
24 Stock total Cadmium HF 1 Normandie 114 4.451820e+00 42.085652 57.06115 81.51849 94.08875 119.30574 146.06862 478.1885 4.065050e+03 5.770000 2.63 189.70439 1.75 269.45418
25 Stock total Cadmium HF 1 Nouvelle Aquitaine 230 5.770280e+00 28.321321 48.07999 79.02535 115.37820 144.95888 224.76483 890.9004 1.345744e+04 6.930000 6.96 287.94898 1.74 416.89143
26 Stock total Cadmium HF 1 Occitanie 214 4.413128e+00 27.851933 48.31998 86.08693 129.07720 144.22892 258.08699 1766.4990 3.162360e+04 11.510000 7.94 280.78263 3.27 404.69753
27 Stock total Cadmium HF 1 Pays de la Loire 114 1.944073e+01 33.484928 46.00962 62.63706 72.67208 84.95246 122.98739 287.5891 1.914690e+03 4.100000 5.26 137.62963 3.51 156.35807
28 Stock total Cadmium HF 1 Provence Alpes Cote D’azur 90 1.841466e+01 43.658369 71.77142 98.18161 113.68923 131.09198 178.84769 546.3982 5.947250e+03 7.960000 7.78 202.67200 2.22 285.35808
29 Stock total Cobalt HF 1 Auvergne Rhone Alpes 222 2.339552e+02 1660.649827 2798.04734 4708.48116 5705.63661 7192.99437 10213.59069 37592.4344 2.489524e+07 283.620000 4.95 13368.40200 2.70 19440.92756
30 Stock total Cobalt HF 1 Bourgogne Franche Comte 133 4.872628e+01 1780.599041 2978.51915 5894.77132 6552.52011 8524.71520 12078.33088 29755.2470 2.146792e+07 396.120000 2.26 16637.67120 0.75 21912.20220
31 Stock total Cobalt HF 1 Bretagne 107 3.187167e+02 1591.261481 2351.26992 3620.06056 4629.70090 5755.55824 7336.71527 44919.1643 2.169187e+07 474.820000 2.80 10114.77300 0.93 15211.38088
32 Stock total Cobalt HF 1 Centre val de Loire 120 6.877770e+01 1339.149905 2408.16278 4258.37088 4628.21177 6149.13450 7958.07927 20077.7049 9.099836e+06 248.910000 2.50 10975.10027 0.83 13460.41938
34 Stock total Cobalt HF 1 France entiere 1683 6.305694e+00 1413.034291 2549.02326 4559.49722 5245.21844 6936.19803 9456.74788 44919.1643 1.580662e+07 88.390000 3.57 13460.41938 0.89 20077.70494
35 Stock total Cobalt HF 1 Grand Est 165 2.744512e+02 1191.673888 2224.04353 5237.55334 5864.79034 8448.27800 11125.93321 30197.2131 1.942922e+07 296.770000 1.21 16115.82453 0.61 22521.97440
36 Stock total Cobalt HF 1 Haut de France 109 1.040397e+03 3547.522126 5152.07268 6133.47480 6034.11730 7004.04642 7868.44671 11421.9511 3.625833e+06 155.710000 9.17 9405.40088 0.00 11421.95108
37 Stock total Cobalt HF 1 Ile de France 39 1.396904e+03 2270.249911 3234.03759 3995.25627 4194.76288 5119.51359 6216.64315 9789.9348 2.973782e+06 320.080000 2.56 7748.73967 0.00 9789.93485
38 Stock total Cobalt HF 1 Normandie 114 6.305694e+00 1843.888354 2985.08152 4223.75013 4235.78842 5395.92033 6380.76742 14538.4612 3.999525e+06 185.020000 0.88 8529.37380 0.88 8529.37380
39 Stock total Cobalt HF 1 Nouvelle Aquitaine 230 1.093355e+02 826.657704 1621.82974 4374.53751 5281.54177 7420.61495 10434.32811 33869.2661 2.116131e+07 290.110000 3.48 15762.52573 0.43 22873.03290
40 Stock total Cobalt HF 1 Occitanie 214 3.056341e+01 1558.781919 2494.33400 4304.71726 5047.94465 6429.21485 9511.03733 29017.2064 1.305611e+07 231.920000 4.21 12364.36778 0.47 16303.32913
41 Stock total Cobalt HF 1 Pays de la Loire 114 6.472562e+02 1363.359325 2111.89875 3931.71375 4794.43564 6365.50071 9339.79089 18364.5629 1.166044e+07 317.780000 3.51 11045.48913 0.00 18364.56287
42 Stock total Cobalt HF 1 Provence Alpes Cote D’azur 90 2.974035e+02 1776.307722 2532.27775 3870.21041 4433.93169 6340.68301 8041.30306 10822.9177 6.074918e+06 288.810000 0.00 10822.91773 0.00 10822.91773
43 Stock total Chrome EDTA 1 Auvergne Rhone Alpes 222 1.243404e+00 14.143454 23.07790 37.44892 44.86518 59.32642 85.28441 321.5824 1.135240e+03 2.100000 1.80 114.45037 0.45 158.39212
44 Stock total Chrome EDTA 1 Bourgogne Franche Comte 133 2.823261e+00 13.238262 19.51248 30.67206 36.09331 45.29268 67.15768 121.9790 5.504900e+02 2.150000 6.02 82.56369 0.00 121.97898
45 Stock total Chrome EDTA 1 Bretagne 107 8.212952e+00 29.517638 43.50690 52.50014 64.68496 78.83839 103.03931 263.5351 1.512560e+03 3.590000 3.74 128.02333 1.87 149.88946
46 Stock total Chrome EDTA 1 Centre val de Loire 120 7.227164e+00 14.012183 21.19006 28.56923 37.77419 42.94778 69.59615 167.8057 7.355000e+02 2.330000 8.33 73.88873 3.33 102.36929
48 Stock total Chrome EDTA 1 France entiere 1683 6.305694e-01 14.016645 23.02388 36.84230 46.21482 56.97129 86.38377 514.4019 1.499250e+03 0.887603 5.53 107.57127 1.54 158.39212
49 Stock total Chrome EDTA 1 Grand Est 165 6.167825e+00 18.057745 25.79802 39.36757 48.32702 61.71725 87.97184 212.1075 1.127710e+03 2.440000 4.24 114.78325 1.82 160.78063
50 Stock total Chrome EDTA 1 Haut de France 109 6.751823e+00 18.276221 23.91534 36.67838 43.35034 50.22858 84.93713 156.2955 8.138000e+02 2.520000 7.34 89.61773 1.83 126.18133
51 Stock total Chrome EDTA 1 Ile de France 39 6.227750e+00 15.104533 22.46212 32.51243 53.38359 58.57754 113.59550 268.4357 2.994510e+03 9.090000 10.26 110.52884 5.13 133.06462
52 Stock total Chrome EDTA 1 Normandie 114 6.305694e-01 22.337249 35.56812 50.22280 61.07515 78.31622 106.48707 254.7640 1.825870e+03 3.760000 3.51 133.00236 2.63 182.14228
53 Stock total Chrome EDTA 1 Nouvelle Aquitaine 230 4.553129e+00 12.871132 20.44977 31.35922 39.26650 44.68290 68.98644 299.6770 1.179770e+03 2.290000 5.65 79.82739 3.04 110.69033
54 Stock total Chrome EDTA 1 Occitanie 214 7.426623e-01 9.464383 16.94018 30.88819 39.01345 50.27980 69.48587 471.9850 1.607840e+03 2.550000 2.80 96.33521 0.93 143.95961
55 Stock total Chrome EDTA 1 Pays de la Loire 114 4.903511e+00 15.294244 25.41030 45.47653 54.13686 69.82839 99.80120 234.5818 1.658170e+03 3.690000 4.39 133.05327 1.75 186.23278
56 Stock total Chrome EDTA 1 Provence Alpes Cote D’azur 90 5.424433e+00 15.453772 23.61143 44.38099 51.29236 70.35034 106.52734 158.3485 1.264030e+03 3.330000 3.33 124.92294 0.00 158.34855
57 Stock total Chrome RMQS1 HF 1 Auvergne Rhone Alpes 222 1.215306e+03 9503.045637 14081.53974 23067.95453 30109.01385 35422.67018 54406.42938 236463.1375 8.945539e+08 1894.720000 5.86 66501.80183 2.70 98355.86308
58 Stock total Chrome RMQS1 HF 1 Bourgogne Franche Comte 132 4.593395e+02 9907.459291 18183.48695 26952.28947 29784.89979 41050.95207 50324.87039 76243.9093 2.658602e+08 1438.770000 0.76 71176.57876 0.00 76243.90933
59 Stock total Chrome RMQS1 HF 1 Bretagne 107 2.446930e+03 11184.523786 16799.60286 25918.65867 35845.25805 31428.50014 38448.93988 1181147.4495 1.259250e+10 11048.450000 0.93 46365.60248 0.93 46365.60248
60 Stock total Chrome RMQS1 HF 1 Centre val de Loire 120 2.054587e+03 6074.120801 11657.63586 21899.92850 20726.99667 28223.82693 34523.61224 57701.6496 1.163326e+08 980.240000 0.83 46656.00785 0.00 57701.64960
62 Stock total Chrome RMQS1 HF 1 France entiere 1682 7.566833e+01 8413.474957 14918.48796 24329.35881 27339.46789 34037.91931 44361.48896 1181147.4495 1.181885e+09 812.360000 2.97 62450.02133 0.83 87586.36891
63 Stock total Chrome RMQS1 HF 1 Grand Est 165 1.969196e+03 6914.744855 13196.00198 30661.02117 30842.53995 44221.81947 53740.45920 97978.5240 3.753538e+08 1385.370000 1.21 83813.57893 0.00 97978.52400
64 Stock total Chrome RMQS1 HF 1 Haut de France 109 4.691949e+03 20805.291650 27194.77667 32360.59742 32411.44564 38130.86236 43528.58247 58959.4038 9.073604e+07 879.370000 4.59 50242.55450 0.00 58959.40376
65 Stock total Chrome RMQS1 HF 1 Ile de France 39 6.833129e+03 12553.792985 15889.65072 20563.57077 21550.43284 28011.05773 31978.36555 37117.9528 6.359971e+07 1027.700000 0.00 37117.95283 0.00 37117.95283
66 Stock total Chrome RMQS1 HF 1 Normandie 114 7.566833e+01 14065.908682 19461.46562 23378.38797 23586.70735 28653.42064 33109.95050 46880.4920 7.386568e+07 830.160000 6.14 40369.76173 0.00 46880.49205
67 Stock total Chrome RMQS1 HF 1 Nouvelle Aquitaine 230 1.040541e+03 5629.443826 11167.00708 23040.70941 23852.39237 33391.03660 41695.88441 77079.8720 2.245654e+08 943.690000 1.30 66558.12633 0.00 77079.87200
68 Stock total Chrome RMQS1 HF 1 Occitanie 214 1.471043e+02 8858.616799 14330.51926 22110.32572 24392.48635 32151.85770 41999.39569 86751.2789 1.926124e+08 878.960000 2.34 54803.07390 0.47 81270.51035
69 Stock total Chrome RMQS1 HF 1 Pays de la Loire 114 3.334397e+03 11147.586036 15203.04067 24187.02104 24540.23096 30325.08668 39950.94031 64186.0287 1.508323e+08 1156.630000 3.51 52432.91693 0.00 64186.02867
70 Stock total Chrome RMQS1 HF 1 Provence Alpes Cote D’azur 90 1.783524e+03 10037.193313 14654.94358 22735.50421 24091.35806 31138.49127 37364.47991 66524.2792 1.533980e+08 1116.930000 2.22 54766.64133 0.00 66524.27922
71 Stock total Cuivre EDTA 1 Auvergne Rhone Alpes 222 3.922602e+01 266.206284 406.84760 810.51069 1802.91601 1526.01705 3373.07118 48814.0026 2.390289e+07 323.500000 10.81 2937.67626 4.95 4774.87346
72 Stock total Cuivre EDTA 1 Bourgogne Franche Comte 133 3.979080e+01 266.088719 446.38355 945.43096 1391.74104 1537.49626 2397.53387 18688.1150 4.467330e+06 164.470000 6.02 3105.58374 2.26 3895.05584
73 Stock total Cuivre EDTA 1 Bretagne 107 8.278600e+01 310.342575 625.63307 1248.90800 1390.55865 1769.52066 2299.38518 9219.0925 1.452614e+06 100.120000 3.74 3422.03143 1.87 4306.28287
74 Stock total Cuivre EDTA 1 Centre val de Loire 120 7.431781e+01 215.679986 421.08693 709.92445 1082.83919 1176.47756 2132.03316 7793.5107 1.497810e+06 114.530000 8.33 2283.01023 4.17 3463.51277
76 Stock total Cuivre EDTA 1 France entiere 1683 2.749283e+01 285.357145 534.33271 1038.45865 2383.60299 1907.28455 4258.37274 100304.8421 3.281088e+07 132.020000 10.40 3895.05584 6.83 6026.11420
77 Stock total Cuivre EDTA 1 Grand Est 165 1.092941e+02 259.363135 492.65833 1077.28373 1586.47257 1917.86124 2946.44622 21398.8495 4.585299e+06 170.190000 6.06 3798.51656 2.42 5597.28064
78 Stock total Cuivre EDTA 1 Haut de France 109 1.976339e+02 887.254923 1401.07354 1779.03089 2037.14789 2622.99002 3573.56736 5504.0532 1.222115e+06 87.450000 4.59 4312.83804 0.00 5504.05322
79 Stock total Cuivre EDTA 1 Ile de France 39 3.176153e+02 472.144006 643.32698 1183.25394 3124.00483 2416.97708 6073.10325 36616.4747 3.928030e+07 936.350000 12.82 4892.44557 7.69 6473.24854
80 Stock total Cuivre EDTA 1 Normandie 114 2.749283e+01 406.937316 679.86885 1055.40274 1223.97468 1564.58918 2025.84409 7400.4859 7.937852e+05 54.110000 2.63 2689.74192 0.88 3607.35824
81 Stock total Cuivre EDTA 1 Nouvelle Aquitaine 230 7.834855e+01 224.128460 448.11041 895.41229 3978.97881 2047.90363 8784.60521 100304.8421 1.210958e+08 699.310000 14.78 4286.70761 13.04 6266.76532
82 Stock total Cuivre EDTA 1 Occitanie 214 5.127226e+01 299.724966 591.92486 1153.52190 4382.20236 3340.39841 13182.46620 46194.5053 6.118079e+07 420.140000 16.36 7379.25973 12.15 11444.73547
83 Stock total Cuivre EDTA 1 Pays de la Loire 114 2.313235e+02 444.341023 610.55987 934.37356 1772.36551 1632.37430 2604.89871 30953.3292 1.141987e+07 301.130000 7.02 3105.24040 5.26 3743.70289
84 Stock total Cuivre EDTA 1 Provence Alpes Cote D’azur 90 1.594804e+02 420.803598 678.06517 1541.53077 3497.33984 4601.36585 10318.01787 21927.6156 2.116223e+07 458.130000 10.00 10238.41465 3.33 14721.45316
85 Stock total Cuivre HF 1 Auvergne Rhone Alpes 222 3.957625e+02 2635.826702 4608.52102 6860.64096 9033.20897 11169.15666 15961.13824 96594.3167 9.037135e+07 606.530000 3.15 20599.56795 1.35 26590.62187
86 Stock total Cuivre HF 1 Bourgogne Franche Comte 133 1.262136e+02 2161.517279 3617.24173 6305.59920 7259.86412 9094.86400 12472.39075 39617.6110 3.112538e+07 486.080000 3.01 16532.33893 1.50 18655.93260
87 Stock total Cuivre HF 1 Bretagne 107 3.187167e+02 2929.889761 5069.88608 8155.19773 8750.63074 11460.55728 14752.83289 31088.3269 2.373543e+07 427.070000 0.93 19585.93341 0.93 19585.93341
88 Stock total Cuivre HF 1 Centre val de Loire 120 4.359923e+02 1602.878815 2830.34914 4641.65670 4931.59087 6057.43100 8085.50787 18221.9627 9.669414e+06 260.980000 4.17 10825.61581 0.83 14661.71467
90 Stock total Cuivre HF 1 France entiere 1683 7.175880e+01 2389.572942 4144.35490 6976.60886 9696.17037 11022.12266 17071.13634 216289.4696 1.499403e+08 269.850000 6.36 21272.43940 3.51 31599.65426
91 Stock total Cuivre HF 1 Grand Est 165 6.626844e+02 2053.634495 3666.78752 7659.87867 8303.53781 11027.51040 14522.58087 45493.3387 3.555045e+07 388.170000 1.82 21272.43940 0.61 29947.03774
92 Stock total Cuivre HF 1 Haut de France 109 1.467191e+03 5619.579553 6904.95656 8540.03476 8719.81356 10441.82939 11952.90281 17906.5885 8.303578e+06 253.660000 3.67 15078.34351 0.00 17906.58846
93 Stock total Cuivre HF 1 Ile de France 39 2.206702e+03 3754.666093 4415.58811 5766.94976 9111.73894 8499.71631 17080.12960 57622.4572 1.068759e+08 1724.250000 12.82 13897.61120 7.69 17721.70987
94 Stock total Cuivre HF 1 Normandie 114 7.175880e+01 2755.127508 4567.58679 5960.40689 6319.01567 7858.96251 9562.31297 19480.2983 9.478260e+06 257.060000 3.51 12555.53647 0.88 16242.72720
95 Stock total Cuivre HF 1 Nouvelle Aquitaine 230 3.434927e+02 1720.129173 3430.09346 6460.39725 12298.62441 12430.80536 24990.20064 152552.9327 3.734425e+08 1306.870000 10.00 24843.87240 5.65 37549.78673
96 Stock total Cuivre HF 1 Occitanie 214 1.642426e+02 2667.824950 4946.15291 9245.21505 15393.75379 15503.21017 35516.68486 216289.4696 4.336807e+08 1307.860000 11.68 30828.62434 7.48 46996.33707
97 Stock total Cuivre HF 1 Pays de la Loire 114 1.426941e+03 2910.506508 3933.21814 5738.23000 7896.53272 8985.88119 14306.00270 66410.7071 5.775787e+07 678.600000 7.02 15710.55178 4.39 19401.90500
98 Stock total Cuivre HF 1 Provence Alpes Cote D’azur 90 7.042922e+02 3612.471173 5639.89383 10164.60349 13488.90330 18383.85200 28030.14350 52232.0985 1.251934e+08 1276.200000 4.44 34099.65120 0.00 52232.09847
99 Stock total Molybdene HF 1 Auvergne Rhone Alpes 222 1.737152e+01 126.565345 204.30153 297.98960 389.99525 400.84606 654.55510 2869.7028 1.539602e+05 24.680000 9.01 696.11870 5.41 956.14331
100 Stock total Molybdene HF 1 Bourgogne Franche Comte 133 1.333341e+01 161.714544 241.33135 365.62715 468.88699 543.46895 927.84741 2647.3220 1.357816e+05 29.400000 8.27 992.23584 3.01 1407.25107
101 Stock total Molybdene HF 1 Bretagne 107 3.175649e+01 201.966427 240.75875 312.49020 348.33244 391.20387 468.99545 1939.4215 4.975078e+04 20.520000 3.74 611.01960 3.74 611.01960
102 Stock total Molybdene HF 1 Centre val de Loire 120 2.740523e+01 75.887799 133.66773 215.05025 215.07629 275.81596 343.42610 805.4023 1.371832e+04 9.540000 2.50 430.40289 0.83 527.15012
104 Stock total Molybdene HF 1 France entiere 1683 5.069778e+00 109.788138 189.99072 286.19639 355.41306 404.25690 600.09802 4220.3441 1.134374e+05 7.840000 6.65 725.03371 3.39 1044.72660
105 Stock total Molybdene HF 1 Grand Est 165 2.926660e+01 99.384689 179.75662 322.01282 450.52311 520.72915 1025.43863 3963.0574 2.390715e+05 36.520000 10.30 1008.35680 2.42 1493.32019
106 Stock total Molybdene HF 1 Haut de France 109 6.559205e+01 235.000287 293.50908 351.02609 361.77543 402.06110 489.48461 1221.8284 1.965059e+04 11.820000 10.09 551.10940 1.83 668.27621
107 Stock total Molybdene HF 1 Ile de France 39 1.246678e+02 157.423344 184.37524 255.01561 289.83267 379.22251 511.29509 669.0673 1.950199e+04 15.170000 0.00 669.06735 0.00 669.06735
108 Stock total Molybdene HF 1 Normandie 114 5.069778e+00 146.766858 195.56426 240.07822 245.53898 289.41197 350.62157 607.5238 9.025520e+03 7.980000 5.26 418.55757 0.88 535.74686
109 Stock total Molybdene HF 1 Nouvelle Aquitaine 230 2.230444e+01 85.274389 158.01858 282.84197 364.45732 444.00858 663.68366 4220.3441 1.621419e+05 26.210000 4.78 858.00110 1.74 1299.09289
110 Stock total Molybdene HF 1 Occitanie 214 5.784197e+00 116.529041 194.16791 284.58482 344.22548 406.94705 583.86743 1907.2464 7.404495e+04 18.010000 6.07 714.74314 2.80 1028.78906
111 Stock total Molybdene HF 1 Pays de la Loire 114 6.262842e+01 124.008578 196.25581 268.53755 322.21494 358.84550 512.85269 3110.0726 9.688781e+04 29.920000 6.14 571.57741 1.75 838.45346
112 Stock total Molybdene HF 1 Provence Alpes Cote D’azur 90 6.195875e+01 125.224958 180.14494 297.54181 334.36177 438.31465 609.14081 1192.4302 4.048497e+04 20.310000 1.11 764.33809 0.00 1192.43019
113 Stock total Plomb EDTA 1 Auvergne Rhone Alpes 222 8.930924e+01 520.049397 1302.14782 1941.91022 2220.99150 2821.35082 3809.97384 11568.7823 2.485017e+06 101.960000 4.05 5084.69568 1.80 7371.36545
114 Stock total Plomb EDTA 1 Bourgogne Franche Comte 133 5.100149e+02 1065.354555 1601.41397 2812.71028 3145.82673 3520.84267 4370.20742 35637.7620 1.302182e+07 321.270000 3.01 5361.36536 1.50 7772.29839
115 Stock total Plomb EDTA 1 Bretagne 107 2.917277e+02 922.181722 1107.19077 1401.95888 1676.35446 1802.30730 2306.79611 10844.5640 1.877261e+06 129.320000 3.74 2829.73728 3.74 2829.73728
116 Stock total Plomb EDTA 1 Centre val de Loire 120 5.003879e+02 894.792297 1474.39396 1903.18301 2217.17689 2546.34816 3418.31842 10971.0433 2.164810e+06 105.560000 5.83 3723.58350 2.50 5399.98693
118 Stock total Plomb EDTA 1 France entiere 1683 8.930924e+01 847.170416 1375.87830 2104.66250 2798.43848 3227.91939 4684.50695 57143.1758 1.286525e+07 82.590000 5.82 5985.76378 2.61 8766.02316
119 Stock total Plomb EDTA 1 Grand Est 165 3.029680e+02 731.635828 1410.87962 2575.14505 3240.00505 3369.62120 4605.60189 55301.2352 3.358500e+07 457.900000 4.24 5672.83664 2.42 8081.42580
120 Stock total Plomb EDTA 1 Haut de France 109 7.455417e+02 2013.964565 2437.80692 3361.78720 4386.98592 4534.18168 6879.26083 55637.9035 3.011327e+07 505.850000 8.26 7616.92684 4.59 10215.79970
121 Stock total Plomb EDTA 1 Ile de France 39 9.406402e+02 1163.884380 1721.75134 2610.27690 6860.92002 6603.99702 12867.82195 57143.1758 1.306989e+08 1659.370000 7.69 13295.53399 5.13 16333.78507
122 Stock total Plomb EDTA 1 Normandie 114 4.523123e+02 1165.105773 1650.58578 2000.21553 2524.69884 2617.17904 4095.79976 17510.9853 4.511775e+06 197.500000 10.53 3919.46244 5.26 4875.94351
123 Stock total Plomb EDTA 1 Nouvelle Aquitaine 230 1.214075e+02 761.620252 1286.53710 2324.68336 2918.81641 3698.48798 5736.44723 15513.5624 5.455555e+06 131.740000 5.65 7335.30689 1.74 10336.71567
124 Stock total Plomb EDTA 1 Occitanie 214 3.579521e+02 762.930855 1376.05865 2192.95121 2795.30225 3319.17577 5124.48525 20784.5291 6.358529e+06 169.790000 7.94 5756.74675 1.87 9156.96440
125 Stock total Plomb EDTA 1 Pays de la Loire 114 3.737923e+02 1050.447517 1438.93712 1880.21037 2276.05454 2541.42218 3633.82122 15499.1747 3.225557e+06 159.680000 7.02 4094.45362 2.63 5530.06612
126 Stock total Plomb EDTA 1 Provence Alpes Cote D’azur 90 5.109768e+02 828.443999 1138.42424 1877.18580 2513.33613 3193.14330 4697.06991 12959.0392 4.039729e+06 200.750000 4.44 5903.84019 2.22 7028.93420
127 Stock total Plomb HF 1 Auvergne Rhone Alpes 222 6.444275e+02 5073.285996 8053.96113 12630.69390 14614.02859 18047.87567 26607.88966 74626.3200 9.625469e+07 553.130000 4.05 32734.68213 0.90 46969.32804
128 Stock total Plomb HF 1 Bourgogne Franche Comte 133 8.795862e+02 5833.036960 9987.85273 15515.94767 17643.61848 20877.41240 28243.23757 126824.2690 2.368074e+08 1311.920000 2.26 36935.09037 2.26 36935.09037
129 Stock total Plomb HF 1 Bretagne 107 2.710897e+03 8812.438136 10137.15831 11622.88026 12794.75212 13525.80445 17022.81864 40826.0315 2.661832e+07 495.170000 9.35 18585.07285 3.74 23652.83627
130 Stock total Plomb HF 1 Centre val de Loire 120 1.904248e+03 6001.325553 9380.80287 13263.28002 13241.55181 16060.56622 21355.12089 30033.6882 3.148214e+07 510.180000 2.50 24339.77329 0.00 30033.68824
132 Stock total Plomb HF 1 France entiere 1683 5.637290e+02 5588.903738 8558.29977 12541.24717 14312.61213 17039.87555 23287.87521 214497.8450 1.315790e+08 264.660000 4.40 29593.91583 1.25 42320.26113
133 Stock total Plomb HF 1 Grand Est 165 2.205099e+03 4876.204511 7371.10653 13263.74280 14867.06682 16775.88427 21441.23800 214497.8450 3.992800e+08 1550.420000 1.82 27824.77787 1.21 38683.99871
134 Stock total Plomb HF 1 Haut de France 109 4.376329e+03 11262.083216 12776.97787 15058.99631 17412.64629 19002.07104 24407.35968 82739.4724 9.044411e+07 765.080000 6.42 26418.67312 2.75 37118.04080
135 Stock total Plomb HF 1 Ile de France 39 4.670427e+03 6037.925487 6645.16126 10086.47054 19788.27883 18079.44974 38299.32369 161809.0198 8.506734e+08 4293.080000 12.82 26546.79144 5.13 49401.66184
136 Stock total Plomb HF 1 Normandie 114 5.637290e+02 7409.265849 8900.08030 10898.63193 11148.93419 12709.62900 14576.63111 42158.3717 2.048613e+07 383.660000 4.39 17826.24507 1.75 23377.49840
137 Stock total Plomb HF 1 Nouvelle Aquitaine 230 1.895878e+03 4899.634993 8038.78066 13610.11505 14399.11628 18189.78607 24727.83444 46899.4536 6.929254e+07 489.560000 3.91 32116.39687 0.00 46899.45360
138 Stock total Plomb HF 1 Occitanie 214 5.755633e+02 5197.254927 8012.50401 12318.33635 13676.70664 16175.37103 22884.23590 66533.4129 7.499628e+07 572.040000 3.74 28332.90930 1.40 37760.95572
139 Stock total Plomb HF 1 Pays de la Loire 114 2.643984e+03 5908.595645 8369.97293 11626.52816 13520.11249 16285.08056 24934.43336 47684.1523 6.452162e+07 716.600000 5.26 28007.67763 1.75 35817.52984
140 Stock total Plomb HF 1 Provence Alpes Cote D’azur 90 2.708386e+03 5395.887867 7723.23395 10445.34996 12952.36122 16279.14923 22292.91810 41120.8561 6.680334e+07 781.260000 5.56 29085.05871 0.00 41120.85615
141 Stock total Zinc EDTA 1 Auvergne Rhone Alpes 222 9.897855e+01 311.994919 447.14494 688.88578 883.27983 971.31838 1785.56208 4738.3476 5.475761e+05 50.590000 10.36 1712.67446 4.95 2346.69372
142 Stock total Zinc EDTA 1 Bourgogne Franche Comte 133 1.465104e+02 388.972290 526.91808 798.64838 1405.05448 1102.46791 1405.85796 48632.7083 2.091748e+07 399.350000 6.02 1857.26016 3.01 2690.48893
143 Stock total Zinc EDTA 1 Bretagne 107 1.552522e+02 451.561120 596.50172 894.69420 1105.17920 1304.32034 2052.23449 4902.7364 5.861704e+05 75.190000 8.41 2184.72039 0.93 3219.72584
144 Stock total Zinc EDTA 1 Centre val de Loire 120 8.767335e+01 240.117561 364.17495 548.37268 632.90038 788.83011 1170.99460 2004.2870 1.546587e+05 36.450000 6.67 1413.54966 0.00 2004.28696
146 Stock total Zinc EDTA 1 France entiere 1683 8.767335e+01 334.361826 493.98854 756.44071 1198.51815 1219.30413 2083.24789 94353.7178 8.710847e+06 64.170000 8.26 2305.87576 3.74 3373.52440
147 Stock total Zinc EDTA 1 Grand Est 165 2.745379e+02 537.091276 679.26605 904.48867 1214.36477 1346.24851 2036.05924 12996.3580 1.470733e+06 97.150000 6.67 2235.09972 3.03 3287.77742
148 Stock total Zinc EDTA 1 Haut de France 109 4.901646e+02 855.500734 1171.20222 1650.81224 2188.64913 2454.94455 3380.17150 23725.5039 6.109272e+06 210.550000 4.59 4126.04845 2.75 5617.76560
149 Stock total Zinc EDTA 1 Ile de France 39 2.937915e+02 399.654614 517.87667 959.51941 4293.02629 1885.19648 4622.40145 94353.7178 2.274842e+08 2391.130000 12.82 3135.85994 7.69 5629.60408
150 Stock total Zinc EDTA 1 Normandie 114 2.280398e+02 460.291998 653.57847 872.49702 1205.94529 1276.78011 1791.06282 12187.1898 1.864076e+06 126.230000 7.89 1883.84438 4.39 2860.19648
151 Stock total Zinc EDTA 1 Nouvelle Aquitaine 230 1.140785e+02 306.213210 396.36799 583.72941 925.88360 1013.80241 1715.95169 11596.2033 1.389191e+06 76.020000 8.70 1865.15843 3.48 2778.49579
152 Stock total Zinc EDTA 1 Occitanie 214 1.116391e+02 291.747314 411.68787 595.47451 1112.42184 966.20162 1900.84598 20047.3156 3.718529e+06 134.440000 10.75 1740.52684 7.94 2536.51846
153 Stock total Zinc EDTA 1 Pays de la Loire 114 2.234614e+02 370.434771 523.72156 763.10336 1031.48646 1167.03926 1882.85522 8054.5490 9.613739e+05 94.470000 7.02 2112.19384 2.63 2865.86955
154 Stock total Zinc EDTA 1 Provence Alpes Cote D’azur 90 1.787957e+02 418.793388 584.28452 865.24160 1255.40434 1368.74976 2406.04709 7494.0771 1.456951e+06 136.410000 8.89 2542.45404 5.56 3602.19912
155 Stock total Zinc HF 1 Auvergne Rhone Alpes 222 2.227478e+03 16188.869828 23120.22994 32074.21336 35627.70564 43251.26189 56453.46380 279695.2383 5.273654e+08 1579.250000 3.60 72303.36933 0.45 89317.16403
156 Stock total Zinc HF 1 Bourgogne Franche Comte 133 1.940674e+03 15438.123365 22764.04795 36755.58356 44840.00913 50642.30400 70186.98856 646923.1888 3.403141e+09 5059.450000 4.51 90032.00800 1.50 121178.72000
157 Stock total Zinc HF 1 Bretagne 107 5.146211e+03 19752.900773 24375.09053 31138.42717 32598.12520 40055.14210 47170.75255 74733.9840 1.335309e+08 1027.740000 0.93 60813.60400 0.00 74733.98400
158 Stock total Zinc HF 1 Centre val de Loire 120 2.440726e+03 9067.588701 13341.67128 20227.22414 22524.43628 29667.82495 37090.63748 64046.8960 1.500560e+08 1034.920000 2.50 49327.00600 0.00 64046.89602
160 Stock total Zinc HF 1 France entiere 1683 6.923652e+02 13256.711183 20433.74352 30505.31020 34502.71504 42029.99226 56533.63622 646923.1888 8.762037e+08 706.130000 3.86 74212.28733 0.83 104208.19813
161 Stock total Zinc HF 1 Grand Est 165 3.505532e+03 13332.083880 21741.36420 35344.35480 37971.28926 49731.24533 65841.47164 170243.2733 4.961922e+08 1485.220000 1.21 87866.81000 0.61 93355.33582
162 Stock total Zinc HF 1 Haut de France 109 1.323788e+04 28447.833073 32444.52000 38634.23240 39091.84398 44252.11031 50157.28021 119021.6928 1.606480e+08 970.960000 5.50 57784.81973 0.92 72067.06970
163 Stock total Zinc HF 1 Ile de France 39 7.087372e+03 16591.032400 18609.53908 25679.90842 34329.05454 35680.71589 50160.93122 259336.0927 1.581099e+09 5856.820000 7.69 56508.90000 2.56 73760.29645
164 Stock total Zinc HF 1 Normandie 114 6.923652e+02 15140.483557 21750.57197 26801.20193 26871.77109 32120.28594 38572.50556 55745.2992 1.059979e+08 703.750000 8.77 45338.93371 0.00 55745.29917
165 Stock total Zinc HF 1 Nouvelle Aquitaine 230 1.649648e+03 9822.034108 17097.79067 28711.02457 32417.16305 43697.62333 60260.30462 104208.1981 4.340071e+08 1295.430000 3.04 82094.92900 0.00 104208.19813
166 Stock total Zinc HF 1 Occitanie 214 8.254977e+02 14073.048129 19615.02570 32613.47206 38636.82764 44929.05807 65019.03812 623538.2992 2.199202e+09 3133.100000 3.74 79737.90242 1.40 118384.89067
167 Stock total Zinc HF 1 Pays de la Loire 114 6.559999e+03 15398.384026 19894.47090 26204.81841 31288.20496 40663.33628 52156.71846 96111.4240 2.994844e+08 1543.350000 3.51 71036.97675 0.00 96111.42401
168 Stock total Zinc HF 1 Provence Alpes Cote D’azur 90 4.528028e+03 15495.899609 20953.32628 30342.48216 35310.75086 46492.11852 56547.15169 179168.0995 5.080463e+08 2324.520000 2.22 66642.37747 1.11 88874.42400